|
From: Rob V. <rv...@vd...> - 2010-06-17 16:13:27
|
Hi Michael
So I'm not entirely sure what the issue is from your description though I have a possible idea. Firstly I need to know what your SPARQL queries look like as without seeing those I can only guess at the issue so if you could send those that would be very helpful. Also if possible can you send some data that will reproduce the issue - a subset of your data which shows the issue would be sufficient.
Secondly I note that you state "entities/nodes" in your report which leads me to believe that some of the things are blank nodes - is this correct? If they are then you may not be getting the behaviour you expect from SPARQL for several reasons:
1) Blank Nodes in a SPARQL query act as anonymous variables rather than node matches. For example the query SELECT * WHERE { _:bnode ?p ?o } would not get all the predicates and objects associated with a specific Blank Node as you might be expecting but rather gets the predicates and objects of every single triple in the store since _:bnode is an anonymous variable.
2) Blank Nodes are scoped to a specific Graph so if you've added the data as several separate graphs then the Blank Node _:bnode in one is not the same as _:bnode in another though they'll have the same Node ID in the database hence why a SQL query would join them while a SPARQL query would not.
3) Blank Nodes labels in the output get automatically rewritten in a number of instances by the SPARQL engine to attempt to uniquely distinguish them since identical labels may have been used across different graphs in the store and as per point 2 these are not the same node
Of course none of the above may be the actual cause of your issue but without seeing any data or SPARQL queries I can only speculate.
Regards,
Rob Vesse
----------------------------------------
From: Michael Friis <fr...@gm...>
Sent: 17 June 2010 15:41
To: dot...@li..., rv...@vd...
Subject: Triples evident in database not visible via Sparql query
(this report hasn't been boiled down completely, apologize)
I have a large graph where I initially assert a lot of triples. These
triples are then visible just fine through Sparql queries. I then
assert some more triples which are not really related to the old ones
(although they concern the same entities/nodes). This causes some of
the original triples to disappear from sparql queries. The specific
triples that are not visible, are those where one of my entities
(UriNodes) are subjects instead of being objects. I can find the
relevant nodes and triples fine in the database (I use MS SQL Server),
they just don't show up when I run Sparql queries.
What's going on?
Here's an example SQL query that shows me the relevant nodes and
triples are in place:
select n2.*, n.*
from TRIPLES t
inner join NODES n on t.tripleObject = n.nodeID
inner join NODES n2 on t.tripleSubject = n2.nodeID
where t.tripleSubject = 27
select n2.*, n.*
from TRIPLES t
inner join NODES n on t.tripleSubject = n.nodeID
inner join NODES n2 on t.tripleObject = n2.nodeID
where t.tripleObject = 27
Regards
Michael
|