protegeproject / swrlapi

Java API for working with the SWRL rule and SQWRL query languages
Other
99 stars 40 forks source link

Question #67

Open mrtnzagustin opened 4 years ago

mrtnzagustin commented 4 years ago

I am thinking of wrapping some of this useful library methods. I need to make some operations from node.js. Specifically i need create swr-rules on the fly, transform to ttl and insert in a graph database. There is a way to run some methods from CLI? for example: java -jar swrlapi.jar -"my swrl rule string" Also, is there any other project related similar to this library but written in javascript?

martinjoconnor commented 4 years ago

I am not aware of many RDF- and OWL-related tools in JavaScript.

If you wanted to interactively invoke the SWRLAPI, you could adapt the following project:

https://github.com/protegeproject/swrlapi-example

Take a look at the main class:

https://github.com/protegeproject/swrlapi-example/blob/master/src/main/java/org/swrlapi/example/SWRLAPIExample.java

You could modify this code to take a SWRL rule or SQWRL query as a parameter and then execute it.

mrtnzagustin commented 4 years ago

@martinjoconnor , thanks!! do you know which method should i use to make this? :

String mySWRLString = "Class(?a) ^ hasSomething(?a, ?b) -> $ClassWithSomething(?a)";
String swrlRuleInTurtleOrOWLSyntax = methodWanted(mySWRLString);

regards!!

martinjoconnor commented 4 years ago

I would post these more general questions to the Protege mailing list.

https://protege.stanford.edu/support.php

It's quite active and you may get a range of responses.