0

I'm trying to querying with SPARQL on a triplestore storing datasets (I speak about a specific group of data stored in a global graph of a triplestore dataset) with metadatas. The metadatas describe how the data are computed. Each datasets has his own metadatas described by two nodes types and two properties types.

##The triples I want :

#The dataset
eg:myDataSet a _:DataSet.

#The nodes
_:N1 a _:NodeAType .
_:N2 a _:NodeAType .
_:N4 a _:NodeAType .
_:N5 a _:NodeAType .

_:N3 a _:NodeBType .
_:N6 a _:NodeBType .

#The properties
_:N2 eg:hasSource _:N1 .
_:N4 eg:hasSource _:N3 .

_:N3 eg:from _:N2 .
_:N6 eg:from _:N4 .
_:N6 eg:from _:N5 .

#Some links to the Dataset
eg:myDataSet eg:hasNodeA _:N2 .
eg:myDataSet eg:hasNodeA _:N5 .
eg:myDataSet eg:hasNodeB _:N6 .


##Some triples I don't want :

eg:myDataSet2 a _:DataSet.
_:N7 a _:NodeAType .
_:N8 a _:NodeBType .
_:N8 eg:from _:N7 .
eg:myDataSet eg:hasNodeB _:N8 .
eg:myDataSet eg:hasNodeA _:N7 .

So I don't see how to query, with SPARQL, all the triples I want, who define my dataset metadatas, when I only know the URI eg:myDataSet. Of course, I don't want the metadatas of the other graphs stored.

Any idea ?

Thibaut Guirimand
  • 851
  • 10
  • 33
  • It's not really clear what you're asking. What are you trying to retrieve? – Joshua Taylor Mar 18 '15 at 13:17
  • OK, then it's not clear: where is all this data stored? as you've written it, it looks like it'd be in a single graph and you could just `select * { ?s ?p ?o }` to get all the triples from it... – Joshua Taylor Mar 18 '15 at 13:35
  • The best case would to retrieve all the triple I've wrote here. Or only the subgraph linked to `eg:myDataSet`. This subgraph contain the nodes `_:N1` `_:N2` `_:N3` and their links. – Thibaut Guirimand Mar 18 '15 at 13:39
  • As I said there are some other datasets in my triplestore. The other datasets `eg:myDataSet2` and `eg:myDataSet3` have their own subgraph composed of `_:NodeAType` and `_:NodeBType`. Asking `select * { ?s ?p ?o }` would return more than the subgraph I want. – Thibaut Guirimand Mar 18 '15 at 13:44
  • I'm not sure how you're using the term datasets here; A SPARQL endpoint exposes a dataset and a dataset has a default graph and any number of named graphs. Can you describe which of the triples you've described are in the default graph and which are in named graphs (and possibly what the names of those named graphs are)? – Joshua Taylor Mar 18 '15 at 13:47
  • I'm currently working with a default graph only. The use of a named graph would allow me to define that all the triples I want to query are part of a specific subgraph (the named graph using `eg:myDataSet` as name and containing all the triples I've define in my example). Querying for this subgraph could be an answer, but this require that I define named graphs when I add data into the dataset. Is that a recommended practice ? It seems that I can't extract a turtle file with defined named graphs inside. So I'm not sure of the easy portability of this method. – Thibaut Guirimand Mar 19 '15 at 14:01
  • OK, if you're just working with the one default graph, the query won't be too hard, but it's still not clear which triples you're trying to select. Can you update the question to show which ones of the triples that you've got in your data that you want to select? – Joshua Taylor Mar 19 '15 at 14:04

0 Answers0