Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add prefix definition #228

Open
stuppie opened this issue Dec 21, 2017 · 2 comments
Open

Add prefix definition #228

stuppie opened this issue Dec 21, 2017 · 2 comments

Comments

@stuppie
Copy link

stuppie commented Dec 21, 2017

Is there a way (preferably on the command line) to add a prefix definition to an ontology?

To give my specific usage, I am trying to merge some triples into an existing ontology however if there is a prefix defined in the triples that doesn't exist in the base file, the full URI is used. How can I add the prefix definition?

@cmungall
Copy link
Member

$ owltools MYFILE.owl -o -h
-o [-f FORMAT] [--prefix PREFIX URI]* FILE         writes source ontology.

e.g.

owltools MYFILE.owl -o -f ofn --prefix FOO http://example.org/foo MYFILE-out.ofn

should work with any owlapi prefix-enabled format

(note prefix definitions are a purely syntactic feature and semantically invisible to the owlapi)

Also for many basic ontology release operations the recommendation is to use robot.

@stuppie
Copy link
Author

stuppie commented Dec 21, 2017

Thanks for the quick response!!

It still didn't work however. Example:

owltools doid-edit.owl --merge tmp.ttl -o -f ofn --prefix skos "http://www.w3.org/2004/02/skos/core#" doid-edit.owl

where doid-edit.owl is: https://github.com/DiseaseOntology/HumanDiseaseOntology/blob/master/src/ontology/doid-edit.owl
and tmp.ttl contains:

@prefix obo:   <http://purl.obolibrary.org/obo/> .
@prefix skos:   <http://www.w3.org/2004/02/skos/core#> .    
obo:DOID_7880  skos:broadMatch  "XXX"^^xsd:string .

I get the following lines in the output file:

Declaration(AnnotationProperty(<http://www.w3.org/2004/02/skos/core#broadMatch>))
AnnotationAssertion(<http://www.w3.org/2004/02/skos/core#broadMatch> obo:DOID_7880 "XXX"^^xsd:string)

where I'm expecting

Prefix(skos:=<http://www.w3.org/2004/02/skos/core#>)
Declaration(AnnotationProperty(skos:broadMatch))
AnnotationAssertion(skos:broadMatch obo:DOID_7880 "XXX"^^xsd:string)

I know they're equivalent, but.. just for git reasons, I'd like it to be the curie

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants