In protege, after synchronizing reasoner, we can find the Explain Inference function with this button:
and then we can get the explanation like this:
The problem is, if I am using Jena with a Pellet reasoner, how can perform the same function with them?
I found a similar question on StackOverflow, but it seems like only works when dealing with native Jena reasoner rather than a third-party reasoner like Pellet.
Thanks in advance.
As far as I can tell from looking at Pellet's source, the explanation module is OWL API specific, so it cannot be used with Jena.
Related
I'm making my way into Rascal - nice work!
I'm halfway through the Tutor and might be getting ahead of myself, but one of my interests is refactoring Java. I've watched Tijs van der Storm's Curry On 2016 talk where he presents an example of this (the "TrafoFields" module around minute 16 in the video).
I was eager to get into this kind of work so I searched the documentation for the Java grammar and a similar example using it, to no avail. What's more, the library documentation has under lang::java only m3 and jdt. I reloaded Tijs' video to find he uses lang::java::\syntax::Java15. I blindly tried importing that in the Repl and it worked (albeit with lots of warnings)! I opened the Rascal .jar file to find there is even more in this package.
So my questions in this context are:
Why is this not in the documentation? I would have expected that the library documentation is exhaustive. Couldn't you at least add "TrafoFields" to the recipes?!
Is there an alternative way of finding out about such modules besides the online documentation (and apart from searching the .jar file)?
What is this weird backslash in the module name before "syntax", ::\syntax?
All good questions; and also implied suggestions for improvement. In the meantime if you get stuck please ask more questions.
Short answer: we've prioritized documenting what is used most and what is used in courses at universities and then what we've received questions about. So thanks for asking.
In reverse order:
The backslash is a generic escape to use identifiers in Rascal which are also keywords in the language. So any variable or package name or module name could be named "if" but you'd have to escape it. This helps a lot when defining abstract syntax trees for programming languages, as you can imagine where "if" would be a great name for an ast node type. "Syntax" happens to be a keyword in Rascal too.
The Rascal explorer view in eclipse can be used to browse through the library interactively. Also you can crawl the library using util::FileSystem and get a first class representation of everything that is in a library like |std:///|. Agreed, these are poorman's solutions and a good feature would a fully indexed searchable library. We're halfway there (see the analysis::text:: Lucene pre-work we've done towards supporting this.
That is a rhetorical question which I accept as a suggestion for improvement 😉😊 the answer is yes.
Similar to #include in C in importing functions and axioms that are defined in another file. I wasn't able to find such functionality described in the SMTLIB documentation or from the online examples. Any hints?
SMTLib has no means of #include'ing or importing other files. This might look like a shortcoming, but it is quite rare for people to hand-write SMTLib files: It is almost always machine generated from a higher level language, and it is assumed that whoever generates the SMTLib can simply spit out one big file that includes everything you need.
Having said that, I think this would be a useful feature to have indeed. SMTLib standard is always evolving and such features are usually discussed in their mailing list:
https://groups.google.com/forum/#!forum/smt-lib
Feel free to join the discussion and make a request!
I have a JSON-LD ontology that I'd like to convert to HTML-documentation.
I've found a few tools that can do that, Ontodocs (Python, generates nice documentation in different themes) and Widoco (Java). These seem to do the job pretty well, but there are some issues with them and I'm now trying to find other similar tools that can do this.
Many of the tools I have found are not really suited for JSON-LD, but more for RDF and OWL ontologies.
It seems that the Hydra specification is using ReSpec for this purpose, but I'm not too familiar with it, and I'd prefer Python for the generation of the documentation.
So, does anyone know of any alternatives to Ontodocs and Widoco?
I am trying to use the built-ins of SWRL in Protege 5.2 but they seem to not function. All my other rules (written without any built-in) are inferred and clearly visible when i start my reasoner (pellet).
I am not sure, whether or not i need to setup something within protege or any other way to use the built-in's. Even a simple example as follows is not working:
Person(?x) ^ hasAge(?x,?age)^ swrlb:greaterThan(?age, 17) -> Adult(?x)
I would appreciate any help. Thanks.
Some of the reasoners don't have support for built-in types even though they support SWRL. Depending on the reasoner you may see a red triangle in the upper right-hand corner of Protege. Clicking on that will detail the error experienced.
Unfortunately I do not know of a reasoner which has support for built-in types for SWRL.
In this case there is a work-around. You can specify:
Class: Adult
hasAge some xsd:int[> "17"^^xsd:int]
If you're using Hermit reasoner, know that it does not support built-in types for SWRL but Pellet Reasoner does. You can install it as a plugin and then, after restarting your application, set Pellet as the reasoner before starting it.
More information here : OWL2 and SWRL Tutorial
Is it also possible to build an ontology with Jena API for example by Java coding in Eclipse? if yes what is the difference between making an ontology in Protege with making an ontology by Jena API in Eclipse?I am really confused about differences as I am not good in java programming.
Lots of thanks
It depends on what you actually want to do. Are you trying to build a new ontology from scratch? Do you have an existing ontology that you want to extend by adding some data. Are you generating lots of triples using pre-existing classes and properties, based on some data you're already processing in Java?
Protege offers a GUI that allows you to create the ontology more quickly. It also gives you a graphical overview of the ontology in creation. It's sometimes hard to get the big picture even with all this help. It's a powerful tool for overall ontology authoring. Writing an entire ontology by scribbling Java code line-by line seems a gruelling task to me.
Writing plain Java code to create an onthology would be very difficult and inefficient. On top of the complexity of RDF itself, you'd need to understand the Jena API. IMO, it only makes sense if you have a well-defined ontology and you're really sure what kind of triples you want to add. In such case, using Java code to interface with some data source could save you a lot of time. Provided that you know Java itself to do it efficiently.
In your case, sticking with Protege seems the most reasonable option.
The answer is yes: it's perfectly possible to create a no ontology through the Jena API and Java code.
The difference between Protege and plain old Java code is the task you need to perform: if you need to inspect an ontology or create a few concepts manually, Protege allows you to do it fairly quickly without writing code first. If you need to execute some repetitive task, on a large number of entities, or carry out something else for which Protege does not cater, then you're better off writing Java code.
This is not different from a question like: is it better to use a text editor or write a Perl script to edit text? It very much depends on the exact task at hand. Both are possible.