Named Graphics v Default Graphic behavior in Apache Jena Fuseki

We are working with Apache Jena Fuseki.

If we unload graphA and graphB

SELECT (COUNT(*) as ?count) FROM <graphA> FROM <graphB> WHERE { ?s ?p ?o . } 

gives 100

If we load triples in A and B by default

 SELECT (COUNT(*) as ?count) WHERE { ?s ?p ?o . } 

gives 200

It seems that there is no conclusion about what happens between the graph and the graph in the FROM example?

How do we fix this?

Found Reasoning with Fuseki, TDB and named graphs? but don't understand if this is the same problem.

Sample data: Graph A:

 Mdworking:Measure a owl:Class ; mdmm:elementName "Measure" . 

Chart B:

 Mddemobank:Account_Balance a owl:Class ; rdfs:subClassOf Mdworking:Measure ; mdmm:elementName "Account_Balance" . Mddemobank:Sub_Account_Balance a owl:Class ; rdfs:subClassOf Mddemobank:Account_Balance ; mdmm:elementName "Sub_Account_Balance" . 

Query:

 SELECT ?subject ?predicate ?object FROM <A> FROM <B> WHERE { ?subject ?predicate ?object } 

does not give output Mddemobank: Sub_Account_Balance subClassOf Mdworking: Measure

I tried the request

 SELECT * { { ?s ?p ?o } UNION { GRAPH ?g { ?s ?p ?o } } } 

which returns triples from A, B and by default, but does not display the derived triplets.

Environment:

 * Tested version 2.6.0 on Ubuntu * Tested version 3.4.0. on Windows 10 * Loaded the test files using the browser 

Here is the assembler file

 @prefix : <http://base/#> . @prefix tdb: <http://jena.hpl.hp.com/2008/tdb#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix fuseki: <http://jena.apache.org/fuseki#> . @prefix : <http://base/#> . @prefix tdb: <http://jena.hpl.hp.com/2008/tdb#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix fuseki: <http://jena.apache.org/fuseki#> . # THE SERVICE <service1> a fuseki:Service ; fuseki:dataset <#dataset> ; fuseki:name "xxx" ; fuseki:serviceQuery "query" , "sparql" ; fuseki:serviceReadGraphStore "get" ; fuseki:serviceReadWriteGraphStore "data" ; fuseki:serviceUpdate "update" ; fuseki:serviceUpload "upload" . # DATASET for the service <#dataset> rdf:type ja:RDFDataset ; rdfs:label "xxx" ; ja:defaultGraph <#model_inf> . # MODEL for dataset <#model_inf> a ja:InfModel ; ja:baseModel <#tdbGraph> ; ja:reasoner [ ja:reasonerURL <http://jena.hpl.hp.com/2003/RDFSExptRuleReasoner> ] . # Graph for the default Model <#tdbGraph> rdf:type tdb:GraphTDB; tdb:dataset <#tdb_dataset_readwrite> . # Dataset for the Graph <#tdb_dataset_readwrite> a tdb:DatasetTDB ; tdb:unionDefaultGraph true ; #if you want all data to available in the default graph #without 'FROM-NAMing them' in the SPARQL query tdb:location "C:\\Programs_other\\apache-jena-fuseki-3.4.0\\apache-jena-fuseki-3.4.0\\run/databases/xxx" . 
+5
source share

Source: https://habr.com/ru/post/1273758/


All Articles