stuckyb / ontopilot

15 stars 2 forks source link

Prefix Management #68

Closed jdeck88 closed 7 years ago

jdeck88 commented 7 years ago

This issue may be more for ontopilot than for this repository, but posting it here it is easier to reference the issue and what is happening. I checked the issues there to see if it was noted but did not see it.

At any rate, there is unpredictable prefix mapping behaviour occurring with reasoned data output.

I posted a file in the Incoming data directory called [unreasoned_data_test] (https://raw.githubusercontent.com/PlantPhenoOntology/ppo_pre_reasoner/master/Incoming/unreasoned_data_test.ttl) that i tested this with.

In this file, we have a specified prefix of:

@prefix ppo: http://www.plantphenology.org/id/ .

This prefix is prefix is used in the body of the reasoned output, without being declared in the header of the reasoned output.

Another curiosity is that some prefixes are declared in the header but not used in the body, e.g.:

<owl:ObjectProperty rdf:about="http://purl.obolibrary.org/obo/OBI_0000295"/>

With xmlns:obo="http://purl.obolibrary.org/obo/" being declared in the header.

I would expect:

<owl:ObjectProperty rdf:about="obo:OBI_0000295"/>
stuckyb commented 7 years ago

Just tested this on my machine and confirmed the problem. Definitely a bug!

stuckyb commented 7 years ago

Okay, I think I have this all fixed. The main issue was that prefixes were getting lost in the process of setting up the output format for writing results. All prefixes in the input file should now be preserved. @jdeck88, can you confirm on your end?

Regarding the second issue, with prefixes being declared in the header but not used in the body, I think this is only happening in entity declarations. E.g., in the example above OBI:0000295 is declared using its full IRI:

<owl:ObjectProperty rdf:about="http://purl.obolibrary.org/obo/OBI_0000295"/>

but everywhere else, the prefix form is used; e.g.,

        <obo:OBI_0000295 rdf:resource="ppo:?phenologicalObservingProcess=1"/>

Is that good enough that we don't need to worry about those declaration IRIs? I tend to think so.

jdeck88 commented 7 years ago

Yep, just verified this is working as advertised. thanks,

stuckyb commented 7 years ago

Great. Thanks for testing, @jdeck88.