> I am running a TDB(1) database under apache-jena-fuseki-4.6.1.
The current Jena version is 5.3.0. 1:: <#prod_inferenceModel> rdf:type ja:InfModel ; ja:baseModel <#prod_baseModel> ;ja:reasoner [ ja:reasonerURL <http://jena.hpl.hp.com/2003/TransitiveReasoner> ] ;
. you use inference on the default graph. 2:: <#prod_dataset> rdf:type ja:RDFDataset ; New (unknown) named graphs will go into memory. 3::Could you have two services - one for the default graph, and one for the named graphs which goes straight to TDB2.
If the names in the TDB2 database align with the ja:namedGraphja:graphName then
fuseki:dataset <#prod_actualDataset> ; should work for the named graphs (no inference). Compaction will be available.There is also the RDFS layer, instead of a reasoner, depending on what inference you wish to see,
https://jena.apache.org/documentation/rdfs/#assembler-rdfs-dataset Andy On 23/01/2025 13:27, [email protected] wrote:
Hi Andy, I had tried "compact", but it didn't seem to work. Deletion and recreation worked, except it seems to have made the database non-persistent. Before this latest issue, I had struggled with a problem that named graph data would not persist. Adding the definitions below solved that problem. I found the tip on the Internet, but unfortunately didn't bookmark it. If I could live without defining every named graph in the config file, that would be much better. The config file text is below. Thanks! Ted Theodore Hills Consultant | Research Phone: +1 212 296-1833 [email protected] ## Fuseki Server configuration file. ## Only named graphs for mondeca included. PREFIX fuseki: <http://jena.apache.org/fuseki#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX tdb1: <http://jena.hpl.hp.com/2008/tdb#> PREFIX tdb2: <http://jena.apache.org/2016/tdb#> PREFIX ja: <http://jena.hpl.hp.com/2005/11/Assembler#> PREFIX : <#> ################## # the production msro triple-store <#prod> rdf:type fuseki:Service ; fuseki:name "prod" ; # http://host:port/prod fuseki:endpoint [ # SPARQL query service # https://www.w3.org/TR/sparql11-protocol/#query-via-get # HTTP GET http://host:port/prod/sparql?query= fuseki:operation fuseki:query ; fuseki:name "sparql" ] ; fuseki:endpoint [ # HTTP GET http://host:port/prod/query?query= # SPARQL query service (alt name) # https://www.w3.org/TR/sparql11-protocol/#query-via-get # HTTP GET http://host:port/prod/query?query= fuseki:operation fuseki:query ; fuseki:name "query" ] ; fuseki:endpoint [ # SPARQL update service # https://www.w3.org/TR/sparql11-protocol/#update-operation # HTTP POST http://host:port/prod/update fuseki:operation fuseki:update ; fuseki:name "update" ] ; fuseki:endpoint [ # SPARQL Graph Store Protocol (read) # https://www.w3.org/TR/2013/REC-sparql11-http-rdf-update-20130321/#http-get fuseki:operation fuseki:gsp_r ; fuseki:name "get" ] ; fuseki:endpoint [ # SPARQL Graph Store Protcol (read and write) # https://www.w3.org/TR/2013/REC-sparql11-http-rdf-update-20130321/#http-put # HTTP PUT http://host:port/prod/data?default or http://host:port/prod/data?graph=<URL> fuseki:operation fuseki:gsp_rw ; fuseki:name "data" ] ; fuseki:dataset <#prod_dataset> ; . <#prod_dataset> rdf:type ja:RDFDataset ; ja:defaultGraph <#prod_inferenceModel> ; ja:namedGraph [ ja:graphName <https://triples.ms.com/msro/__analysts__> ; ja:graph <#prod_graphAnalysts> ] ; ja:namedGraph [ ja:graphName <https://triples.ms.com/msro/__analystsUpdate__> ; ja:graph <#prod_graphAnalystsUpdate> ] ; ja:namedGraph [ ja:graphName <https://triples.ms.com/msro/__coverage__> ; ja:graph <#prod_graphCoverage> ] ; ja:namedGraph [ ja:graphName <https://triples.ms.com/msro/__industries__> ; ja:graph <#prod_graphIndustries> ] ; ja:namedGraph [ ja:graphName <https://triples.ms.com/msro/__industryCoverage__> ; ja:graph <#prod_graphIndustryCoverage> ] ; ja:namedGraph [ ja:graphName <https://triples.ms.com/msro/__mscore__> ; ja:graph <#prod_graphMscore> ] ; ja:namedGraph [ ja:graphName <https://triples.ms.com/msro/__mscoreorig__> ; ja:graph <#prod_graphMscoreorig> ] ; ja:namedGraph [ ja:graphName <https://triples.ms.com/msro/__msro__> ; ja:graph <#prod_graphMsro> ] ; ja:namedGraph [ ja:graphName <https://triples.ms.com/msro/__msroindiv__> ; ja:graph <#prod_graphMsroindiv> ] ; ja:namedGraph [ ja:graphName <https://triples.ms.com/msro/__msromondeca__> ; ja:graph <#prod_graphMsromondeca> ] ; ja:namedGraph [ ja:graphName <https://triples.ms.com/msro/__searchesknowl__> ; ja:graph <#prod_graphSearchesknowl> ] ; ja:namedGraph [ ja:graphName <https://triples.ms.com/msro/__searchesoccur__> ; ja:graph <#prod_graphSearchesoccur> ] ; ja:namedGraph [ ja:graphName <https://triples.ms.com/msro/__taxo__> ; ja:graph <#prod_graphTaxo> ] ; . <#prod_graphAnalysts> rdf:type tdb2:GraphTDB2 ; tdb2:dataset <#prod_actualDataset> ; tdb2:graphName <https://triples.ms.com/msro/__analysts__> ; . <#prod_graphAnalystsUpdate> rdf:type tdb2:GraphTDB2 ; tdb2:dataset <#prod_actualDataset> ; tdb2:graphName <https://triples.ms.com/msro/__analystsUpdate__> ; . <#prod_graphCoverage> rdf:type tdb2:GraphTDB2 ; tdb2:dataset <#prod_actualDataset> ; tdb2:graphName <https://triples.ms.com/msro/__coverage__> ; . <#prod_graphIndustries> rdf:type tdb2:GraphTDB2 ; tdb2:dataset <#prod_actualDataset> ; tdb2:graphName <https://triples.ms.com/msro/__industries__> ; . <#prod_graphIndustryCoverage> rdf:type tdb2:GraphTDB2 ; tdb2:dataset <#prod_actualDataset> ; tdb2:graphName <https://triples.ms.com/msro/__industryCoverage__> ; . <#prod_graphMscore> rdf:type tdb2:GraphTDB2 ; tdb2:dataset <#prod_actualDataset> ; tdb2:graphName <https://triples.ms.com/msro/__mscore__> ; . <#prod_graphMscoreorig> rdf:type tdb2:GraphTDB2 ; tdb2:dataset <#prod_actualDataset> ; tdb2:graphName <https://triples.ms.com/msro/__mscoreorig__> ; . <#prod_graphMsro> rdf:type tdb2:GraphTDB2 ; tdb2:dataset <#prod_actualDataset> ; tdb2:graphName <https://triples.ms.com/msro/__msro__> ; . <#prod_graphMsroindiv> rdf:type tdb2:GraphTDB2 ; tdb2:dataset <#prod_actualDataset> ; tdb2:graphName <https://triples.ms.com/msro/__msroindiv__> ; . <#prod_graphMsromondeca> rdf:type tdb2:GraphTDB2 ; tdb2:dataset <#prod_actualDataset> ; tdb2:graphName <https://triples.ms.com/msro/__msromondeca__> ; . <#prod_graphSearchesknowl> rdf:type tdb2:GraphTDB2 ; tdb2:dataset <#prod_actualDataset> ; tdb2:graphName <https://triples.ms.com/msro/__searchesknowl__> ; . <#prod_graphSearchesoccur> rdf:type tdb2:GraphTDB2 ; tdb2:dataset <#prod_actualDataset> ; tdb2:graphName <https://triples.ms.com/msro/__searchesoccur__> ; . <#prod_graphTaxo> rdf:type tdb2:GraphTDB2 ; tdb2:dataset <#prod_actualDataset> ; tdb2:graphName <https://triples.ms.com/msro/__taxo__> ; . <#prod_inferenceModel> rdf:type ja:InfModel ; ja:baseModel <#prod_baseModel> ; ja:reasoner [ ja:reasonerURL <http://jena.hpl.hp.com/2003/TransitiveReasoner> ] ; . <#prod_baseModel> rdf:type tdb2:GraphTDB2 ; tdb2:dataset <#prod_actualDataset> ; . <#prod_actualDataset> rdf:type tdb2:DatasetTDB2 ; tdb2:location "C:\\Users\\hillsthe\\run\\data\\tdb2" ; . -----Original Message----- From: Andy Seaborne <[email protected]> Sent: Thursday, January 23, 2025 8:04 AM To: [email protected] Subject: Re: [EXTERNAL] Re: Fuseki Data Not Persistent > One note: The main reason I wanted to recreate the database was to reduce its size, which had grown enormous. Ted, Have you tried using "compact" on the database? This can be done by the server. After a compacted database is cerated (e.g. "Data-0002") you can delete "Data-0001" (or the compact request can ask for deletion. We can't see the configuration file. It sounds like the configuration is not passing data to the TDB dataset because there is an intermediate layer specificed. Do you use inference? Andy On 21/01/2025 13:21, Rob @ DNR wrote:Attachments are filtered from the list, please either copy paste the configuration into the email body, or if it is very large put it on a paste sharing service list GitHub gist/Pastebin and provide a link * I've found that if a named graph isn't explicitly mentioned in the config file, it will not be persistent That sounds very strange, there should be no need to explicitly mention your named graphs in the configuration file. * Is there something I have to tell fuseki, that it should persist triples, which it had recorded in the previous database but is not indicated in the recreated database? No, unless you’ve explicitly configured a non-persistent database then the default configurations should create persistent databases. So it probably depends how far your configuration has diverged from the common defaults people tend to start from. Rob From: [email protected] <[email protected]> Date: Tuesday, 21 January 2025 at 12:25 To: [email protected] <[email protected]> Subject: SPAM-LOW: RE: [EXTERNAL] Re: Fuseki Data Not Persistent 4. I start Fuseki under Windows from the command line with this command: %FUSEKI_HOME%\fuseki-server.bat --conf %MSRO_HOME%\fuseki_config.ttl I've attached the fuseki_config.ttl file. It's rather long because I've found that if a named graph isn't explicitly mentioned in the config file, it will not be persistent, and I have to repeat these definitions for 9 databases. I'm focused on the "prod" database only at the moment, so you can ignore the rest. Also, I've tried deleting the config file definitions for the graph I dropped (companies), but it made no difference. 5. I load the n-quads with this curl command: curl -H 'Content-Type: application/n-quads' -w 'code=%{http_code} connect=%{http_connect} bytes=%{size_upload} ##' -T /tmp/loadFuseki.2224.ttl http://localhost:3030/prod/data The tmp file has a .ttl extension, but in fact it contains n-quads. The filename is generated by a script of mine. I grep the output for "code" "connect" and "bytes". Code is 200 (success), bytes=128456749, and connect is blank (no proxy). I am able to query the triples just fine, but when I stop and restart Fuseki, they are gone. What is greatly mystifying is that this problem seems to have started when I deleted and recreated the database, but I had not changed the config file. Is there something I have to tell fuseki, that it should persist triples, which it had recorded in the previous database but is not indicated in the recreated database? Your help is greatly appreciated! Theodore Hills Consultant | Research Phone: +1 212 296-1833 [email protected] -----Original Message----- From: Lorenz Buehmann <[email protected]> Sent: Tuesday, January 21, 2025 2:29 AM To: [email protected] Subject: [EXTERNAL] Re: Fuseki Data Not Persistent Hi, can you add details on steps 4 and 5 please? You're starting Fuseki with a configuration targeting a TDB1 database? Or did you accidentally start it in in-memory mode? How do you load the quads? Via SPARQL? Via CLI? Cheers, Lorenz On 20.01.25 23:27, [email protected] wrote:Hi, I'm having a problem which happened once before under circumstances I could correct. This time, I am mystified. I am running a TDB(1) database under apache-jena-fuseki-4.6.1. 1. I backup my database using curl -XPOST http://localhost:3030/\$/backup/prod<http://localhost:3030/$/backup/prod><http://localhost:3030/$/backup/prod%3chttp:/localhost:3030/$/backup/prod%3e> 2. I stop Fuseki with ^C. 3. I delete the Data-0001 directory. 4. I start Fuseki. It recreates an empty triple store. 5. I load quads from the backup. 6. I query my named graphs, counting triples, and they're all there. 7. I stop Fuseki with ^C. 8. I restart Fuseki. 9. My triples are gone. Any ideas what could cause this? One note: The main reason I wanted to recreate the database was to reduce its size, which had grown enormous. When I tried to reload, Fuseki ran out of heap space. No problem: I filtered the n-quads, removing all the quads destined for one of the named graphs I didn't really need anymore, and it loaded just fine. Could something have gone wrong because I removed all of the quads belonging to one graph? Thanks, Ted Theodore Hills Consultant | Research Phone: +1 212 296-1833 [email protected]<mailto:Theodore.Hills@morganstanley. com> ________________________________ For important information including analyst certification and disclosures regarding specific companies, derivatives, or other instruments discussed in this email, please refer to the latest report, if attached and/or hyperlinked to this email, or by logging on to the Morgan Stanley Matrix Platform at http://matrix.ms.com/eqr/research . You may also refer to the Morgan Stanley Research Disclosure Website at http://www.morganstanley.com/eqr/disclosures/webapp/coverage. Morgan Stanley will make certain research products and announcements available only on the Morgan Stanley Matrix Platform. The content provided in this email, including data or any attachments, is subject to the terms and conditions of use (available at https://ny.matrix.ms.com/matrix/portal/docs/terms/index.html#/terms/general ) applicable to research materials accessed through Matrix, including the terms regarding confidentiality and intellectual property rights. For access to the Morgan Stanley Matrix Platform please contact your sales representative or go to http://matrix.ms.com/eqr/research. NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers If you cannot access these links, please notify us by reply message and we will send the contents to you. By messaging with Morgan Stanley you consent to the foregoing. You may have certain rights regarding the information that Morgan Stanley collects about you. Please see our Privacy Pledge https://www.morganstanley.com/privacy-pledge for more information about your rights.-- Lorenz Bühmann Research Associate/Scientific Developer Email [email protected] Institute for Applied Informatics e.V. (InfAI) | Goerdelerring 9 | 04109 Leipzig | Germany ________________________________ For important information including analyst certification and disclosures regarding specific companies, derivatives, or other instruments discussed in this email, please refer to the latest report, if attached and/or hyperlinked to this email, or by logging on to the Morgan Stanley Matrix Platform at http://matrix.ms.com/eqr/research . You may also refer to the Morgan Stanley Research Disclosure Website at http://www.morganstanley.com/eqr/disclosures/webapp/coverage. Morgan Stanley will make certain research products and announcements available only on the Morgan Stanley Matrix Platform. The content provided in this email, including data or any attachments, is subject to the terms and conditions of use (available at https://ny.matrix.ms.com/matrix/portal/docs/terms/index.html#/terms/general ) applicable to research materials accessed through Matrix, including the terms regarding confidentiality and intellectual property rights. For access to the Morgan Stanley Matrix Platform please contact your sales representative or go to http://matrix.ms.com/eqr/research. NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers If you cannot access these links, please notify us by reply message and we will send the contents to you. By messaging with Morgan Stanley you consent to the foregoing. You may have certain rights regarding the information that Morgan Stanley collects about you. Please see our Privacy Pledge https://www.morganstanley.com/privacy-pledge for more information about your rights.________________________________ For important information including analyst certification and disclosures regarding specific companies, derivatives, or other instruments discussed in this email, please refer to the latest report, if attached and/or hyperlinked to this email, or by logging on to the Morgan Stanley Matrix Platform at http://matrix.ms.com/eqr/research . You may also refer to the Morgan Stanley Research Disclosure Website at http://www.morganstanley.com/eqr/disclosures/webapp/coverage. Morgan Stanley will make certain research products and announcements available only on the Morgan Stanley Matrix Platform. The content provided in this email, including data or any attachments, is subject to the terms and conditions of use (available at https://ny.matrix.ms.com/matrix/portal/docs/terms/index.html#/terms/general ) applicable to research materials accessed through Matrix, including the terms regarding confidentiality and intellectual property rights. For access to the Morgan Stanley Matrix Platform please contact your sales representative or go to http://matrix.ms.com/eqr/research. NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers If you cannot access these links, please notify us by reply message and we will send the contents to you. By messaging with Morgan Stanley you consent to the foregoing. You may have certain rights regarding the information that Morgan Stanley collects about you. Please see our Privacy Pledge https://www.morganstanley.com/privacy-pledge for more information about your rights.
