Questions tagged [owlready]

Owlready is a module for ontology-oriented programming in Python, including an optimized RDF quadstore.

Owlready can:

  • Import OWL 2.0 ontologies in NTriples, RDF/XML or OWL/XML format.
  • Export OWL 2.0 ontologies to NTriples or RDF/XML.
  • Manipulates ontology classes, instances and properties transparently, as if they were normal Python objects.
  • Add Python methods to ontology classes.
  • Perform automatic classification of classes and instances, using the HermiT reasoner.
122 questions
6
votes
2 answers

merge two ontologies using owlready

I have made 2 ontologies using owlready2 library list(ontology1.classes()) [old_dataset_ontology.weather, old_dataset_ontology.season] list(ontology1.individuals()) [old_dataset_ontology.rainy, old_dataset_ontology.windy, …
xavi
  • 80
  • 1
  • 12
5
votes
1 answer

Use HermiT in Python

We have an ontology but we need to use the reasoner HermiT to infer the sentiment of a given expression. We have no idea how to use and implement a reasoner in python and we could not find a good explanation on the internet. We found that we can use…
K. Project
  • 112
  • 7
5
votes
0 answers

Owlready2 access axioms

I am having trouble accessing the axioms of classes of an existing ontology. I know that some class contains an axiom that I need. For example the class "cold" contains the axioms: Cold ⊓ Beer ⊑ Positive, and Cold ⊓ Pizza ⊑ Negative Is there a way…
jv3768
  • 322
  • 3
  • 14
4
votes
1 answer

SWRL rules in OWL 2

I'm currently discovering all the possibilities of the Owlready library. Right now I'm trying to process some SWRL rules and so far it's been going very good, but I'm stuck at one point. I've defined some rules in my ontology and now I want to see…
mathbbandstuff
  • 215
  • 1
  • 5
4
votes
0 answers

How can I query Object Properties in an OWL ontology

I am working with the FoodOn ontology and need to figure out if a certain class is somehow related to another class. Typical use case: Can a vegan person eat honey? No, because honey is a subsub class of "invertebrate animal food product"! I am…
Solarer
  • 71
  • 1
4
votes
0 answers

Python: load "Einstein zebra puzzle"-ontology with owlready

I want to solve the famous zebra puzzle by A. Einstein with the help of semantic web tools for python, preferably owlready . The starting point are two owl-files linked in https://github.com/RDFLib/OWL-RL/issues/3. The first one (XML-syntax) works…
cknoll
  • 2,130
  • 4
  • 18
  • 34
4
votes
1 answer

Retrieve rdf labels in an OWL/RDF ontology using Owlready2

I'm working on a project in which i need to retrieve rdf:label values of human/mouse ontologies and run a matcher on those labels. However, I can't seem to find a built-in Owlready2 method that can return all labels from all classes in the ontology.…
3
votes
0 answers

Redundant superclass in ontology after reasoning (owlready)

I try to understand the rector-normalization-technique for ontologies in detail. I use owlready to implement the examples. The article recommends to have a asserted single inheritance structure and introduce multiple inheritance by inference. As…
cknoll
  • 2,130
  • 4
  • 18
  • 34
3
votes
1 answer

Loading ontology via owlready yields error

I would like to use the ontology "dbnary" and I am using owlready When trying to load the ontology from the website, I get this error : Maybe I am using the wrong library, is there a library to work with ontology in turtle format. I want to extract…
kely789456123
  • 605
  • 1
  • 6
  • 21
3
votes
0 answers

python: parse owl file in manchester syntax to owlready

Is it possible to parse an ontology given in manchester syntax such that it ends up as an owlready ontology-object. This is what I found out so far: Owlready itself can only import "NTriples, RDF/XML or OWL/XML format" (ref1). Ontospy can (among…
cknoll
  • 2,130
  • 4
  • 18
  • 34
3
votes
1 answer

Delete individuals with owlready2

I am using owlready2 I load my ontology and I tried to delete the individuals of a class : from owlready2 import * onto =…
kloud
  • 221
  • 1
  • 10
3
votes
0 answers

Sum of two data property of two individuals

hi I am working with ontology on protege 5.5.0 I have a concept : 'Country' which have individuals: Italy, Spain, France.... Each of the individual have a data property cases I want to have a new individual Europe which have the same data property…
kloud
  • 221
  • 1
  • 10
3
votes
1 answer

OwlReadyInconsistentOntologyError while running Hermit resoner with OWLReady library

I have a simple ontology file created using python and OWLReady, when I tried to do resoning with following code it shows OwlReadyInconsistentOntologyError: C:\ProgramData\Anaconda3\lib\site-packages\owlready2\reasoning.py in…
RatheeshTS
  • 411
  • 3
  • 15
2
votes
1 answer

Accessing Annotation of an Entity of ontology using owlready

I want to access the annotation properties of an entity from an ontology using owlready library. In the screenshot below I want to access the definition of the selected Entity i.e. impulse control disorder. from owlready2 import * onto =…
ASLAN
  • 629
  • 1
  • 7
  • 20
2
votes
1 answer

Loading an ontology from string in Python

We have a Pyspark pair RDD which stores the path of .owl files as key and the file contents as value. I wish to carry out reasoning using Owlready2. To load an ontology from OWL files, the get_ontology() function is used. However, the given function…
Kautuk Raj
  • 29
  • 4
1
2 3
8 9