简体   繁体   中英

How to convert a string to OWL Object Property in Java?

I am writing a DL query parser in Java. I need to use the method getObjectPropertyValues(). how to convert a string to OWL Object Property expression in Java , please give me a sample code.

You create an OWLObjectProperty using the aptly named OWLDataFactory.getOWLObjectProperty(IRI iri) , and IRI has a constructor IRI(String) . Eg, from the examples in the documentation:

OWLObjectProperty prop
  = factory.getOWLObjectProperty(IRI.create(ontologyIRI + "#propA"));

如果您使用的是OWLAPI,则可以重复使用此处的代码来解析DL查询: https//github.com/owlcs/owlapi/wiki/DL-Queries-with-a-real-reasoner

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM