General understanding of implementing an ontology with owlready

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

General understanding of implementing an ontology with owlready

jpg_nabble
Hello all,
I am a beginner with owlready.
I would like to implement an ontology composed of classes and properties of other ontologies. I have understood the general comcept and workings of olwready but i seem to bug when implementing it.

Let me illustrate:

I have an ontodogy diagram like this but more complex where the center node is the new concept i want to create and instanciate.  The predicates (Arrows) as well as the objects (branch nodes) are concepts taken from other existing ontologies.  


I wuld like to map tabular data to this ontology but I dont understand how to plug everything together with owlready. So far I have:

----Pseudocode----

default_world.set_backend(filename = "pymedtermino.sqlite3")
PYM = get_ontology("http://PYM/").load()

snomed = PYM["SNOMEDCT_US"]
icd = PYM["ICD10"]

myontology = get_ontology("http://myroortURI.com/")

with myontology:
      class Mysmokingconcept(Thing): pass

and then I bug !

--- questions--

1 can someone show me how to implement the diagram correctly ?  
2 Do i have to create classes for the SNOMED and ICD concepts  as well  or can i simply adress them through SNOMED["IDHERE"]?
3 How do i instantiate instances of Mysmokingconcept with all the properties in one go ?
4. The namespace of the imported ontologies is not correct for my usecase. I would like to change the namespace for the SNOMED and ICD ontologies. Now they all start with "https://PYM/"

I hope I could describe my issue somewhat understandeable

Thank you for your time
JPG


Reply | Threaded
Open this post in threaded view
|

Re: General understanding of implementing an ontology with owlready

Jiba
Administrator
Hi,

> 1 can someone show me how to implement the diagram correctly ?

If the properties and the other concepts are already created in other ontologies, you have nothing more to do!

> 2 Do i have to create classes for the SNOMED and ICD concepts  as well  or can i simply adress them through SNOMED["IDHERE"]?

You can simply address them through SNOMED["IDHERE"].

However, notice that the attribute concept of SNOMED CT are actually represented by classes in PyMedTermino -- you should probably create the 3 properties.

> 3 How do i instantiate instances of Mysmokingconcept with all the properties in one go ?

You can do:

c = Mysmokingconcept(prop_name1 = [SNOMED["ID1HERE"]],
                                  prop_name2 = [SNOMED["ID2HERE"]],...)

> 4. The namespace of the imported ontologies is not correct for my usecase. I would like to change the namespace for the SNOMED and ICD ontologies. Now they all start with "https://PYM/"

https://PYM/ is the URL for PyMedTermino2; you cannot modify that prefix since it is part of PyMedTermino.

Jiba