I am working on research project in which are studying the success of tooth restoration procedures (i.e., fillings). We are collecting data from a number dental practices, and we are going to aggregate all the data into a GraphDB triple store. My question has to do with how to use GraphDB contexts in order to store all the data in a single repo, but still be able to query each practice individually when needed. I am using the Free edition of GraphDB, version 7.0.3, and the GraphDB workbench.
When I import data in the repo, it gives me the option to specify a context. My understanding is that this is essentially a subgraph of the whole RDF graph. Right? But I am a little unsure as to how this differs from the base URI. In the example page, both the base URI and context are the same.
My general thought on how to set the repo up is to give it a base URI, and keep the base URI the same for each practice data set, but change the context when loading each practice. For example:
To load practice 1 data:
base URI: www.example.com/dental-practices/
context: www.example.com/dental-practices/practice-1To load practice 2 data:
base URI: www.example.com/dental-practices/
context: www.example.com/dental-practices/practice-2To load practice 3 data:
base URI: www.example.com/dental-practices/
context: www.example.com/dental-practices/practice-3
... and so on ...
To query the aggregate of all the data (I suppose), I would use a SPARQL query that doesn't specify a graph. For example, to find all patients:
select ?patient where { ?patient rdf:type :Patient }
But, how would I query a particular practice? Would I specify a graph or use the "from" keywork. For example:
select ?patient from <practice-1> where { ?patient rdf:type :Patient }
or
select ?patient where { graph <practice-1> { ?patient rdf:type :Patient } }
Finally, does anyone know where there a page/documentation explaining how to effectively use a context?