Hello Christophe,

I've re-tested everything on smaller graphs and it looks quite ok.
The probable reason of your trouble is a confusion between graphs and
graph groups. When a query contains FROM <iri-of-graph-group> it deals
with data from that graph group, ignoring a graph if it shares an iri
with a graph group. Most likely you need an additional

DB.DBA.RDF_GRAPH_GROUP_INS
('http://fr.dbpedia.org','http://fr.dbpedia.org');

statement.

I've attached a script that makes two similar graph groups and
illustrates the issue via only four triples.

With non-public data, there's one more source for confusions (but
dbpedia is clearly not the example, there is no security there at all).
Permission for obtaining the list of graphs of graph group (bit 8 set
for graph group IRI permissions) does not imply and access permissions
on member graphs of group, including graph that uses the IRI of a graph
group. If dbpedia were secret and you would like to allow me read it
you'd set bit 1 for http://fr.dbpedia.org/live ,
http://static.fr.dbpedia.org and other member graph IRIs, and both bit 8
and bit 1 (i.e., value 9) for http://fr.dbpedia.org IRI .

Best Regards,

Ivan Mikhailov
OpenLink Software
http://virtuoso.openlinksw.com


On Sun, 2014-05-25 at 11:35 +0200, Christophe Desclaux wrote:
> Hello,
> so i'm creating a french version of dbpedia using the
> extraction-framework from dbpedia, and I have a problem with inserted
> datas which are saved in graph "http://fr.dbpedia.org"; but with sparql
> request i can't get the datas:
> 
> I created new virtuoso (Version 7.1.0.3207-pthreads as of Apr  4 2014)
> database with the following virtuoso.ini
> <https://gist.github.com/descl/98bfa481bd3a9d068f1d>.
> I installed new version of DBpedia vad for this test.
> 
> My extraction files are
> in /home/extraction-framework/datas/frwiki/20140521
> root@ns384501:/home/extraction-framework/datas/frwiki/20140521# ls
> frwiki-20140521-article-categories.nt.gz  
> frwiki-20140521-infobox-properties.nt.gz            
> frwiki-20140521-redirects.nt.gz
> frwiki-20140521-article-templates.nt.gz   
> frwiki-20140521-infobox-property-definitions.nt.gz  
> frwiki-20140521-revision-ids.nt.gz
> frwiki-20140521-category-labels.nt.gz     frwiki-20140521-infobox-test.nt.gz  
>                 frwiki-20140521-revision-uris.nt.gz
> frwiki-20140521-disambiguations.nt.gz     
> frwiki-20140521-instance-types.nt.gz                
> frwiki-20140521-skos-categories.nt.gz
> frwiki-20140521-download-complete         
> frwiki-20140521-interlanguage-links.nt.gz           
> frwiki-20140521-specific-mappingbased-properties.nt.gz
> frwiki-20140521-external-links.nt.gz      frwiki-20140521-labels.nt.gz        
>                 frwiki-20140521-template-redirects.obj
> frwiki-20140521-extraction-complete       
> frwiki-20140521-mappingbased-properties.nt.gz       
> frwiki-20140521-topical-concepts.nt.gz
> frwiki-20140521-french-population.nt.gz   frwiki-20140521-page-ids.nt.gz      
>                 frwiki-20140521-wikipedia-links.nt.gz
> frwiki-20140521-geo-coordinates.nt.gz     frwiki-20140521-page-links.nt.gz    
>                 global.graph
> frwiki-20140521-homepages.nt.gz           frwiki-20140521-pages-articles.xml  
>                 index.html
> frwiki-20140521-images.nt.gz              frwiki-20140521-pnd.nt.gz
> 
> There is the global.graph file with "http://fr.dbpedia.org"; inside.
> In order to have datas inserted in the triplestore i used the
> following commands:
> 
> 
> set password dba *****; 
> DB.DBA.RDF_GRAPH_GROUP_CREATE ('http://fr.dbpedia.org',1); 
> DB.DBA.RDF_GRAPH_GROUP_INS
> ('http://fr.dbpedia.org','http://fr.dbpedia.org/live');
> DB.DBA.RDF_GRAPH_GROUP_INS
> ('http://fr.dbpedia.org','http://static.fr.dbpedia.org');
> DB.DBA.RDF_GRAPH_GROUP_INS
> ('http://fr.dbpedia.org','http://fr.dbpedia.org/resource/classes#');
> log_enable(3,1);
> registry_set ('dbp_decode_iri', 'on');
> registry_set ('dbp_domain', 'http://fr.dbpedia.org');
> registry_set ('dbp_graph', 'http://fr.dbpedia.org');
> registry_set ('dbp_lang', 'fr'); 
> registry_set ('dbp_DynamicLocal', 'off');
> registry_set ('dbp_category', 'Catégorie');
> registry_set ('dbp_imprint', 'http://dbpedia.fr/doc/Imprint');
> registry_set ('dbp_website',
> 'http://wimmics.inria.fr/projects/dbpedia/');
> registry_set ('dbp_lhost', ':80');
> registry_set ('dbp_vhost', 'dbpedia.org');
> vad_install('/usr/local/share/virtuoso/vad/dbpedia_dav.vad', 0);
> vad_install('/usr/local/share/virtuoso/vad/rdf_mappers_dav.vad', 0);
> ld_dir('/home/extraction-framework/datas/frwiki/20140521/','*.nt.gz',
> 'http://static.fr.dbpedia.org');
> rdf_loader_run(); 
> 
> Now my datas are on http://live.fr.dbpedia.org/sparql
> 
> If i make the following request (thanks Julien Plu for help)
> select * from <http://fr.dbpedia.org> where
> {<http://fr.dbpedia.org/resource/France> ?a ?b} LIMIT 100
> => no results
> 
> But with:
> select * where {graph <http://fr.dbpedia.org>
> {<http://fr.dbpedia.org/resource/France> ?a ?b}} LIMIT 100
> => I have the triples ! :'(
> 
> IfI can't put my datas in the well graph i can't have results in
> http://live.fr.dbpedia.org/data/France.ntriples
> 
> 
> Julien Cojan helped gave me a isql request in order to know graph for
> triples:
> select top 5 id_to_iri(G) as G_iri, id_to_iri(S) as S_iri,
> id_to_iri(P) as P_iri, id_to_iri(O) as O_iri from DB.DBA.RDF_QUAD
> where S=iri_to_id('http://fr.dbpedia.org/resource/Paris') and
> P=iri_to_id('http://www.w3.org/1999/02/22-rdf-syntax-ns#type');
> 
> G_iri
> S_iri
> P_iri
> O_iri
> LONG VARCHAR
> LONG VARCHAR
> LONG VARCHAR
> LONG VARCHAR
> _______________________________________________________________________________
> 
> http://fr.dbpedia.org
> http://fr.dbpedia.org/resource/Paris
> http://www.w3.org/1999/02/22-rdf-syntax-ns#type
> http://www.w3.org/2002/07/owl#Thing
> http://fr.dbpedia.org
> http://fr.dbpedia.org/resource/Paris
> http://www.w3.org/1999/02/22-rdf-syntax-ns#type
> http://www.w3.org/2004/02/skos/core#Concept
> http://fr.dbpedia.org
> http://fr.dbpedia.org/resource/Paris
> http://www.w3.org/1999/02/22-rdf-syntax-ns#type
> http://schema.org/Place
> http://fr.dbpedia.org
> http://fr.dbpedia.org/resource/Paris
> http://www.w3.org/1999/02/22-rdf-syntax-ns#type
> http://dbpedia.org/ontology/Place
> http://fr.dbpedia.org
> http://fr.dbpedia.org/resource/Paris
> http://www.w3.org/1999/02/22-rdf-syntax-ns#type
> http://dbpedia.org/ontology/PopulatedPlace
> 
> 5 Rows. -- 1 msec.
> 
> It's saying that my datas are in the good graph...
> 
> 
> I have no solution yet for solving the problem. To you have ideas of
> solutions?

> Thanks! Chris


set echo on;
set verbose off;

DB.DBA.RDF_GRAPH_GROUP_CREATE ('http://group.example.org/',1);
DB.DBA.RDF_GRAPH_GROUP_INS ('http://group.example.org/','http://member1.example.org/');
DB.DBA.RDF_GRAPH_GROUP_INS ('http://group.example.org/','http://member2.example.org/');

DB.DBA.RDF_GRAPH_GROUP_CREATE ('http://group-w-self.example.org/',1);
DB.DBA.RDF_GRAPH_GROUP_INS ('http://group-w-self.example.org/','http://group-w-self.example.org/');
DB.DBA.RDF_GRAPH_GROUP_INS ('http://group-w-self.example.org/','http://member1.example.org/');
DB.DBA.RDF_GRAPH_GROUP_INS ('http://group-w-self.example.org/','http://member2.example.org/');

sparql insert in <http://group.example.org/> { <s0> rdfs:comment "This triple is stored in group.example.org graph, however the group.example.org graph is not member of group.example.org group" };
sparql insert in <http://group-w-self.example.org/> { <s0self> rdfs:comment "This triple is stored in group-w-self.example.org graph and can be accessed via group-w-self.example.org graph group as well" };
sparql insert in <http://member1.example.org/> { <s1> rdfs:comment "This triple is stored in member1.example.org so it can be accessed both via that graph and via two graph groups" };
sparql insert in <http://member2.example.org/> { <s2> rdfs:comment "This triple is stored in member2.example.org so it can be accessed both via that graph and via two graph groups" };

sparql select ?o from <http://group.example.org/> where { ?s ?p ?o };
sparql select ?o from <http://group-w-self.example.org/> where { ?s ?p ?o };
sparql select ?o from <http://member1.example.org/> where { ?s ?p ?o };

sparql select ?o from named <http://group.example.org/> where { graph ?g { ?s ?p ?o } };
sparql select ?o from named <http://group-w-self.example.org/> where { graph ?g { ?s ?p ?o } };
sparql select ?o from named <http://member1.example.org/> where { graph ?g { ?s ?p ?o } };

sparql select ?o where { graph <http://group.example.org/> { ?s ?p ?o } };
sparql select ?o where { graph <http://group-w-self.example.org/> { ?s ?p ?o } };
sparql select ?o where { graph <http://member1.example.org/> { ?s ?p ?o } };
Connected to OpenLink Virtuoso
Driver: 07.10.3210 OpenLink Virtuoso ODBC Driver

-- Line 2: set verbose off

-- Line 4: DB.DBA.RDF_GRAPH_GROUP_CREATE ('http://group.example.org/',1)

-- Line 5: DB.DBA.RDF_GRAPH_GROUP_INS ('http://group.example.org/','http://member1.example.org/')

-- Line 6: DB.DBA.RDF_GRAPH_GROUP_INS ('http://group.example.org/','http://member2.example.org/')

-- Line 8: DB.DBA.RDF_GRAPH_GROUP_CREATE ('http://group-w-self.example.org/',1)

-- Line 9: DB.DBA.RDF_GRAPH_GROUP_INS ('http://group-w-self.example.org/','http://group-w-self.example.org/')

-- Line 10: DB.DBA.RDF_GRAPH_GROUP_INS ('http://group-w-self.example.org/','http://member1.example.org/')

-- Line 11: DB.DBA.RDF_GRAPH_GROUP_INS ('http://group-w-self.example.org/','http://member2.example.org/')

-- Line 13: sparql insert in <http://group.example.org/> { <s0> rdfs:comment "This triple is stored in group.example.org graph, however the group.example.org graph is not member of group.example.org group" }

-- Line 14: sparql insert in <http://group-w-self.example.org/> { <s0self> rdfs:comment "This triple is stored in group-w-self.example.org graph and can be accessed via group-w-self.example.org graph group as well" }

-- Line 15: sparql insert in <http://member1.example.org/> { <s1> rdfs:comment "This triple is stored in member1.example.org so it can be accessed both via that graph and via two graph groups" }

-- Line 16: sparql insert in <http://member2.example.org/> { <s2> rdfs:comment "This triple is stored in member2.example.org so it can be accessed both via that graph and via two graph groups" }

-- Line 18: sparql select ?o from <http://group.example.org/> where { ?s ?p ?o }
o
VARCHAR
_______________________________________________________________________________

This triple is stored in member1.example.org so it can be accessed both via that graph and via two graph groups
This triple is stored in member2.example.org so it can be accessed both via that graph and via two graph groups

-- Line 19: sparql select ?o from <http://group-w-self.example.org/> where { ?s ?p ?o }
o
VARCHAR
_______________________________________________________________________________

This triple is stored in group-w-self.example.org graph and can be accessed via group-w-self.example.org graph group as well
This triple is stored in member1.example.org so it can be accessed both via that graph and via two graph groups
This triple is stored in member2.example.org so it can be accessed both via that graph and via two graph groups

-- Line 20: sparql select ?o from <http://member1.example.org/> where { ?s ?p ?o }
o
VARCHAR
_______________________________________________________________________________

This triple is stored in member1.example.org so it can be accessed both via that graph and via two graph groups

-- Line 22: sparql select ?o from named <http://group.example.org/> where { graph ?g { ?s ?p ?o } }

*** Error 37000: VD [Virtuoso Server]SQ074: Line 1: SP031: SPARQL compiler: <http://group.example.org/> is graph group, not a plain graph, so it can not be used in FROM NAMED clause
at line 22 of Command-Line-Load graphs-and-groups.sql:
sparql select ?o from named <http://group.example.org/> where { graph ?g { ?s ?p ?o } }

-- Line 23: sparql select ?o from named <http://group-w-self.example.org/> where { graph ?g { ?s ?p ?o } }

*** Error 37000: VD [Virtuoso Server]SQ074: Line 1: SP031: SPARQL compiler: <http://group-w-self.example.org/> is graph group, not a plain graph, so it can not be used in FROM NAMED clause
at line 23 of Command-Line-Load graphs-and-groups.sql:
sparql select ?o from named <http://group-w-self.example.org/> where { graph ?g { ?s ?p ?o } }

-- Line 24: sparql select ?o from named <http://member1.example.org/> where { graph ?g { ?s ?p ?o } }
o
VARCHAR
_______________________________________________________________________________

This triple is stored in member1.example.org so it can be accessed both via that graph and via two graph groups

-- Line 26: sparql select ?o where { graph <http://group.example.org/> { ?s ?p ?o } }
o
VARCHAR
_______________________________________________________________________________

This triple is stored in group.example.org graph, however the group.example.org graph is not member of group.example.org group

-- Line 27: sparql select ?o where { graph <http://group-w-self.example.org/> { ?s ?p ?o } }
o
VARCHAR
_______________________________________________________________________________

This triple is stored in group-w-self.example.org graph and can be accessed via group-w-self.example.org graph group as well

-- Line 28: sparql select ?o where { graph <http://member1.example.org/> { ?s ?p ?o } }
o
VARCHAR
_______________________________________________________________________________

This triple is stored in member1.example.org so it can be accessed both via that graph and via two graph groups
------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users

Reply via email to