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
0
votes
1 answer

How can I assign and keep more than one value to the same variable in a for loop?

I wonder how can I assign more than one value to a variable, without loosing the first value assigned. I have the following example, where a certain sales product (in one column) is assigned a package name value (in another column) : Sales product =…
0
votes
1 answer

can not get my individuals from my ontology using search method in owlready python

I have an ontology : https://raw.githubusercontent.com/amiraelsayed/lumiere/master/lumiere3.owl I want to get all lessons for specific class called CS-Java I have tried to use owlready search method and add to it filtration with lesson name and…
Amira Elsayed Ismail
  • 9,216
  • 30
  • 92
  • 175
0
votes
2 answers

How do I assimilate to an individual the same data property n times

For example, I have the data property "name" in my ontology and I want to assimilate to an individual more than one data property "name". onto = get_ontology("teste.owl").load() for line in list: individual = onto.Class('individuo1') …
0
votes
0 answers

OwlReady Ontology Parsing Error while loading ontology

I am trying to load the ontology http://semrob-ontology.mpi.aass.oru.se/OntoCity.owl using the OwlReady python library from owlready2 import * onto = get_ontology("http://semrob-ontology.mpi.aass.oru.se/OntoCity.owl").load() The traceback thread is…
0
votes
1 answer

Protégé: Différent results between DL Query and SPARQL Query

Here is a small ontology called wildlife.owl, created by Protégé, in which I have classes animal, carnivore, herbivore, lion, giraffe, and individuals Léo (a lion), Gigi (a giraffe) and Giginou (also a giraffe). In the ontology I only declare that…
yannis
  • 819
  • 1
  • 9
  • 26
0
votes
1 answer

Class inheritance and instantiation - confusion between internal calls to __init__() and __new__() methods

This is a follow-up question to a problem I previously posted that was partially resolved with the answer I received. The scenario is that I have 1 class that is defined at run time, that inherits from a class that is defined based on a type:…
Cracoras
  • 347
  • 3
  • 16
0
votes
0 answers

AttributeError: 'NoneType' object has no attribute 'some' in owlready libraries

I'm trying to create a class called pizza in the ontology of pizza_onto with the owlready library. but I get the following error. what would be the reason? Owlready Code: (pizza.py) from owlready2 import…
Murat Kılınç
  • 175
  • 3
  • 16
0
votes
1 answer

TypeError: expected string or bytes-like object in owlready library

I'm trying to query data with python in the owl file I created using the owlready library. But I get the following error. what would be the reason? The code structure and received error are as follows. from owlready2 import * from urllib.request…
Murat Kılınç
  • 175
  • 3
  • 16
0
votes
0 answers

owlready2 API failing to access https links

I faced a very basic issue that Owlready2 API get_topology() API failed to read HTTPS URL link to my owl file. There are solutions in case of URLLIB APIs; however, I do not know how it is handled in case of OwlReady2 APIs. If I use the 'HTTP' based…
AnilJ
  • 1,951
  • 2
  • 33
  • 60
0
votes
0 answers

how to read the resource url of rdf:range using owlready2 library in python?

I used dbpedia.owl file and load the ontology with owlready2 library. I want to know how can I access the rdf:resource under rdfs:domain tag. Their docs have no any clue to do this. Following shows current code status. from owlready2 import * #…
Amila Senadheera
  • 12,229
  • 15
  • 27
  • 43
0
votes
2 answers

Consistency checking using Hermit reasoner in Python for an Ontology

I am using owlready2 api for python to load an Ontology and check consistency for that ontology using the sync_reasoner() function. But it seems that it is not checking the consistency for the ontology. Although there is an error, it shows nothing!…
Bayzid
  • 105
  • 11
0
votes
1 answer

Owlready2 parsing error when calling sync_reasoner

The ontology was created using protege and populated data from database using the owlready2 library. Now this line is giving this error: sync_reasoner(my_world) This is the error I have encountered: Could not parse ontology. Either a suitable…
Tharindu
  • 386
  • 3
  • 17
0
votes
1 answer

TypeError: 'float' object is not iterable trying to convert number to float

I realise this error has been posted several times on the website, but none of the solutions seem to work for my problem. I would like to invoke elements from my list (which consists of numbers between 0.0-1.0, and is called numbers) by index,…
Dantuzzo
  • 271
  • 6
  • 25
0
votes
2 answers

Unable to import owlready in Python

I am trying to use the owlready library in Python. I downloaded the file from link(https://pypi.python.org/pypi/Owlready) but when I am importing owlready I am getting following error: >>> from owlready import * Traceback (most recent call…
neha
  • 335
  • 3
  • 5
  • 19
-1
votes
2 answers

How to use python and java on drone.io?

I develop a python project which uses the package owlready2. For some of its functionality owlready2 explicitly makes calls like java -jar ... via the subprocess-package. On my local machine this works fine. Now I want to setup CI with drone.io. My…
cknoll
  • 2,130
  • 4
  • 18
  • 34
1 2 3
8
9