0

Hi I am an Ontology beginner,

I have built an Ontology and saved the RDF file with rule enabled using Protege. I am going to build a web service that takes some inputs from the Ontology. The inputs can be provided by querying the arguments, class and property predicates under swrl:something swrlb:something tags.

I am using java language and trying Jena framework. But there is no SWRL-related vocabulary, even though I have imported rule reasoners [I am not sure whether importing reasoners will add the SWRL vocabularies].

Are there any hints to add SWRL vocabularies into Jena framework?

I haven't looked into Jena rules yet, I believe that it is different to SWRL.

Thanks,

  • There is no SWRL reasoner in Jena so I'm wondering what you want to achieve by "adding SWRL vocabulary"? – UninformedUser Apr 06 '17 at 12:05
  • Hi @AKSW model.listResourcesWithProperty(**RDFS.subClassOf**); How to retrieve any SWRL.argument1 tags to replace the bold syntax? – Retno Aulia Vinarti Apr 06 '17 at 12:33
  • For the pellet reasoner, SWRL VOCABULARY for jena is here : https://github.com/Galigator/openllet/tree/integration/module-jena/src/main/java/openllet/jena/vocabulary (as well as the OWL2 vocabulary); maybe you should watch "owlapi5" instead of "jena" – Galigator Apr 06 '17 at 13:12
  • Thanks @Galigator! – Retno Aulia Vinarti Apr 06 '17 at 13:35
  • Well, now I understand what you mean. But this are just constants in Java which are shortcuts for the URIs of the elements. I don't understand why you need them. Jena only contains the most common ones for convenience, e.g. OWL, RDF and RDFS. If you have a look at the source code of those classes, you can see that all you have to do is to call `model.createResource(uri)` or `model.createProperty(uri)` for any element of any vocabulary that you need. E.g. `model.listResourcesWithProperty(model.createProperty(http://www.w3.org/2003/11/swrlb#lessThan))` – UninformedUser Apr 07 '17 at 04:20
  • Thanks @AKSW for the explanation. I am trying to build a prediction model by taking some inputs from an RDF.. – Retno Aulia Vinarti Apr 12 '17 at 13:48

0 Answers0