Reputation: 21
I'm trying to learn how to use Blazegraph. I have created an ontology and added it to the database. No problems. Blazegraph seems easy to use. Now to my question. I notice that if I query the database now, I get triples from the ontology as answers from sparql queries. So if I add data to the same database, the answers from sparql queries will be from the ontology mixed with the data itself. Should I not keep the ontology in the same database, or how do I avoid mixing the ontology with the data?
Upvotes: 1
Views: 418
Reputation: 1020
To avoid mixing the ontology with the data, you can namespace the ontology. For example,
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
<#JW>
a foaf:Person ;
foaf:name "James Wales" ;
foaf:mbox <mailto:[email protected]> ;
foaf:homepage <http://www.jameswales.com> ;
foaf:nick "Jimbo" ;
foaf:depiction <http://www.jameswales.com/aus_img_small.jpg> ;
foaf:interest <http://www.wikimedia.org> ;
foaf:knows [
a foaf:Person ;
foaf:name "Angela Beesley"
] .
<http://www.wikimedia.org>
rdfs:label "Wikimedia" .
rdf
, rdfs
, and foaf
are all ontologies. Instead of bringing all of them into the document, they're declared in the namespace. You can point the namespace to your owl file (or whatever your ontology is in) and use it the same way. Blazegraph will still be able to reason over the graph as long as it can access the ontology definition.
Upvotes: 0