filename as namespace?

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

filename as namespace?

Hello, I'm using the tool as a component of a web app, where the user has to upload an ontology file. Classes and properties are extracted with owlready and mapped to Java classes and attributes using an annotation tool.

1) I would like to place in my java source code also the pairs "xlmns:prefix = uri" that occur at the beginning of the ontology file. Is there a way to extract them in some sort of way? onto._namespaces containes only the base URI

2) Most importantly, I noticed that owlready2 stores some properties lying on the base namespace with a qualified name like this : "filename.propertyName" but I don't want to deal with filenames. An example:

FILENAME: it.owl


<?xml version="1.0"?>
<rdf:RDF xmlns=""
    <owl:Ontology rdf:about="">
        <dc:language rdf:datatype="">english</dc:language>

    ... blablabla...


    <owl:ObjectProperty rdf:about="">
        <rdf:type rdf:resource=""/>
        <rdf:type rdf:resource=""/>


Is there a way to sistematically get rid of filenames used as prefix by substituting them with a "dummy" prefix that points to the base URI? Thank you

Reply | Threaded
Open this post in threaded view

Re: filename as namespace?

To clarify:
What I'm trying to obtain is something like this:

The matching of the ontology term against the Java element is something I already take care of, now I have to annotate the Java elements in a consistent fashion...without "surprises" let's say
Reply | Threaded
Open this post in threaded view

Re: filename as namespace?

In reply to this post by mskx4

1) XML prefixes are used when parsing the OWL files, but they are not stored in the quadstore since they are not RDF triples. Thus, it is currently not possible to obtain them.

2) By default, Owlready display entity as "". You can change this default behaviour with set_render_func(). See doc here: