Translate an Attempto DRS into Web Ontology Language (OWL 2),
or if this fails then to Semantic Web Rule Language (SWRL).
If the translation fails then we search for errors by traversing
the respective structure (e.g. implication) again. Note that the error
capture is not completely implemented. Sometimes the translation simply
fails and no explanatory messages are asserted.
- author
- - Kaarel Kaljurand
- version
- - 2010-11-14
- license
- - LGPLv3
TODO
:
- general:
- put "tricks" into a separate module
- low priority: add a trick: if a DRS maps to a SWRL rule which uses sameAs/differentFrom,
but replacing these with normal object properties would make the rule expressible
directly in OWL (probably SubPropertyOf with property composition),
then replace these with ace:equal/ace:differ-from (with equivalent
definitions) and express the rule in OWL syntax.
- allow:
- URGENT: John likes at least 3 cars that Mary likes. (wrong translation)
- URGENT: Which member of Attempto is a productive-developer? (currently fails)
- URGENT: support: What are the countries that contain Paris?
- Every man is a human and sees the human.
- John's age is not 21.
- John's age is 21 or is 22.
- Every man owns something that is "abc". (because we do allow: Every man owns "abc".)
- For everything X for every thing Y if X likes Y then X does not hate Y.
- Every dog hates every cat. (MAYBE)
- Mary eats some grass. (because we do allow: Everybody that eats some meat is a carnivore.)
- Every lady's pets are nothing but cats. (instead to/in addition to: Every lady's pet is nothing but cats.)
- Every lady is somebody whose pets are more than 3 cats. (instead/in addition to: Every lady is somebody whose pet is more than 3 cats.)
- John likes more than 3 women that own a car.
- Every man is himself. (currently generates SWRL, but we could generate nothing in this case)
- check:
- if the syntax is according to the spec: DataProperty, DataValue, DataType
- Are the following equivalent, if so then handle all of them (currently some are rejected):
-- t(166, 'No city overlaps-with a city that is not the city.').
-- t(167, 'Every city overlaps-with itself or does not overlap-with a city.').
-- t(168, 'If a city overlaps-with something X then X is the city or X is not a city.').
- better error messages for:
- No card is valid.
- Every man does not have to cook a chicken.
- Every singular is every singular. (from the log)
- top-level negation
- top-level disjunction
- RDF/XML (deprecated):
- There is something X. If X likes Mary then John sees Bill. (fails to be translated to RDF/XML)
- What borders itself? (otherwise OK, but fails to be translated into RDF/XML)
- improve:
- implement namespaces support, i.e. each name should actually be a term ':'(NS, Name)
- better support for anonymous individuals (don't numbervar the DRS, this would make things easier)
- seems to be fixed:
- John owns a car. John is a man. What is it?
- drs_to_owlswrl(+Drs:term, -Owl:term) is semidet
- drs_to_owlswrl(+Drs:term, +IRI:atom, -Owl:term) is semidet
- drs_to_owlswrl(+Drs:term, +IRI:atom, +Comment:atom, -Owl:term) is semidet
- Converts an Attempto DRS into OWL 2/SWRL.
In the beginning, the DRS is modified by drs_to_owldrs/2 in order to make
the processing more straight-forward.
- Arguments:
-
Drs | - is an Attempto DRS |
IRI | - is a IRI relative to which all class names are to be interpreted |
Comment | - is a comment to be inserted into the resulting ontology (currently ignored) |
Owl | - is an OWL ontology in the form 'Ontology'(IRI, Axioms) where Axioms
is a list of axioms that correspond to the DRS conditions, in OWL FSS (Prolog notation) |
Undocumented predicates
The following predicates are exported, but not or incorrectly documented.
- drs_to_owlswrl(Arg1, Arg2, Arg3, Arg4)