Using FaCT to understand a complex subject...
Hi Ignazio and Dmitry
I'am new to FaCT (Ontologies ecc...) and I am trying to understand howto work because I am fascinated from it. After installed it with success on Ubuntu 12.04 (report included), setting envoirment variable like 'export XERCESCROOT=/usr/local/include/xercesc' and inserted g++ compiler options ('-std=c++0x' and '-I/usr/lib/jvm/java-7-openjdk-amd64/include/') at the first line of Makefile.include, I have loaded your example of ontology from source file but now, I have some question: 1) If possible, how can I run FaCT as "HTTP DIG Reasoner" to be queried by API on listen port (the README file in source code cannot help me)? 2) If FaCT run as server, there are API written in perl or c++ language for using it on small website? 3) Once API is created can it possible make queries for individuals (owl dl) like in protege? 4) Can you tell me howto of FaCT on Internet for beginners?
Thanks for your patience.
Marco
Comments (17)
-
-
Hi Evgeny
I have already read the page, but at moment I need only to know a method to query FaCT++via C/C++/Perl API. I have already load an ontology manually via file LISP but how can I start "DL Query" to FaCT++ like on Protege? Is there a method?
Thank for your reply.
-
Hi Marco,
I'm pretty sure while using C/C++ you shouldn't follow the OWL Java API, as done in Protege. Probably starting from this example: FaCT++.C/test.c is a way to go. Eventually, you need to convert triples to DL axioms. See [1], [2] and other sources. But I hope Dmitry will be able to shed more light on that.
PS please feel free to upvote https://bitbucket.org/dtsarkov/factplusplus/issues/21/documentation-examples
-
Ok
I will try to follow your valuable advice in the hope that also can help me Dmitry.
Thanks Evgeny
-
Hi Evgeny
I looked at the link you provided but they are completely out of my skills and to understand (maybe) what is written should take years ... What I seek is a small tutorial on how to run through at least one of the programming languages mentioned above the DL Query to FaCT++ in order to get individuals / classes of an ontology (maybe by loading the ontology, and interrogating it through reasoner using c/c++ functions).
-
repo owner Hi Marco,
Currently FaCT++ does not provide HTTP API. It used to support DIG 1.1 interface up to version 1.6.0. Then the DIG 2.0 aka OWLLink has been developed, so DIG 1.1 became obsolete. At the same time it became clear that in-place reasoner is much faster than the remote one. The DIG interface had been abandoned, as it only supports OWL 1.
Currently I do not have resources to implement OWLLink interface.
-
Dear Dmitry,
thanks a lot for your answer, which is important for me as well.
So wrt OWL 2 ontologies the OWL Java API is now the only recommended way of I/O, right?
-
repo owner I'd say that OWL API (Java) is the simplest way to load and manipulate the ontology for now. One can use owl-cpp (I never use it myself) or C++/C API provided by FaCT++. However OWL API provides an interoperability with other reasoners, support of large number of OWL formats and is well supported.
I have plans to implement a command-line FaCT++ that supports functional syntax, but have no ETA on when this will happen (hopefully, before the next ORE competition).
-
Hi Dmitry
Where I can found documentation about C++/C API provided by FaCT++? It is technically possible (or very complicated) convert full ontology to - inferred axioms as an ontology like some owl editors functionality but with C++/C api?
Thanks
-
repo owner Hi Marco,
I'll try to pus some docs about API and functionality on the site, but this would probably be not earlier than mid January.
There is currently no way to represent inferred axiom straight from inside FaCT++. It is not very clear what inferred axioms would one expect. As the most useful reasoning task is classification/realisation, it might be pairs of subsumed classes.
It is possible to get a Taxonomy object after classification -- look at the getCTaxonomy() method in Kernel.h . It returns a transitive reduct of the subsumption relation between all classes in the ontology. One can easily transform this structure into a set of subsumption/equality axioms. However, it contains both told and inferred axioms.
-
Hi Dmitry
You have give me a good notice! Without some documentation it's very difficult for me understand (hoping to understand then the complex subject), therefore I am waiting for ...
Thank for your reply and happy new year!
Marco
-
In my fork of the repo, I have just committed an example of creating a transitive and symmetric property
https://bitbucket.org/wrobell/factplusplus/commits/4bc135a9e4343d11d8e46f5fe6fdcf0b2333be94
The example uses Python bindings I have created using Python CFFI library. Maybe someone will find this useful.
On the inferred axioms. The example in the above commit creates three individuals "c", "d", "e" and sets relationship with a role "r"
(c, r, d) (d, r, e)
Because "r" is symmetric and transitive I would expect to be able to retrieve from the kernel the following triples
(d, r, c) # due to symmetry (e, r, d) (c, r, e) # due to transitivity (e, r, c) # due to transitivity and symmetry
If I understand above comments well, this is not possible at the moment?
-
Hi Artur, I will try the same in Protege using Fact++ via OWL Java API.
-
Thanks Evgeny.
BTW. I have just committed few more example on my fork. They demonstrate use of data property cardinality, object property cardinality and creation of disjoint classes.
-
To answer my own question about retrieval of inferred triples due to symmetric and transitive properties. One can use
ReasoningKernel.getRoleFillers
method to get all related individuals (see example at https://bitbucket.org/wrobell/factplusplus/src/factpp/factpp/examples/test-property.py). -
I have just implemented very crude example of a FaCT++ based graph store for Python RDFLib library
https://bitbucket.org/wrobell/factplusplus/src/factpp/factpp/examples/rdflib-store.py
The example creates simple FOAF ontology and uses SPARQL query to retrieve people who know each other.
The example could be developed further to embed it within some web application.
NOTE: The RDFLib store got replaced by Coras project: https://bitbucket.org/wrobell/coras. The project uses RDFLib to load an ontology and FaCT++ for reasoning (via
factpp
bindings). -
On the new Python bindings: https://bitbucket.org/dtsarkov/factplusplus/issues/74
- Log in to comment
Hello, may be this will at least partially help you: http://owl-cpp.sourceforge.net/tutorial_cpp.html