1

Not sure if it is a dumb question, but I am looking for an example program using rdflib which works with local ontology. I am seeing lots of examples using standard ontolgies like FOAF, but I want to write a python program that works with a user defined ontology file on local machine, creates a graph and nodes and arcs from the definitions from locally available ontology file. Is it possible? Are there any guide lines etc.

Laeeq Khan
  • 167
  • 10
  • you can load any RDF data with rdflib. Not sure what you mean by "guideline" but the rdfib docs (obviously) show how to load data – UninformedUser Dec 14 '20 at 06:49

1 Answers1

0

RDF data can exist independently on its ontology, indeed it must be able to exist independently.

Ontology in terms of RDF is a description of the entities, properties and classes. It can specify human-readable labels or comments so that users of it know how to use it. It can link to other vocabularies so that tools that work with other ontologies might pick the meaning of your data without understanding your exact vocabulary. It can store implications and constraints so that reasoners can infer additional facts from a dataset, or check if a dataset is consistent in the first place.

That being said, you don't need to explicitly write it down to create a dataset. You most definitely should attempt to write it, but your data can live without it, and some things can be inferred from the data itself.

<a> a <c> .
<a> <p> <d> .

Already you can infer that <p> is a property, that <c> is a class, and <a> is probably neither.

IS4
  • 11,945
  • 2
  • 47
  • 86
  • I think could be a literal or a resource, why do you say is necessarily a class? – Laeeq Khan Dec 20 '20 at 01:53
  • @LaeeqKhan Because `rdfs:range` of `rdf:type` is `rdfs:Class`. It can also be a literal or a resource, but it must be a class. – IS4 Dec 20 '20 at 02:02
  • I wonder if the OP meant do you need to use a public namespace url? I'm working on a sensitive project that cannot be hosted externally and am trying to figure out the same. – June Sep 02 '22 at 18:52