Try:
load_module(library(thea/owl2_io)).
load_axioms('family.owl).
save_axioms('family.pl',dlp).
> thanks, it worked!
>
> One more thing, after conversion the facts were as follows:
>
> % propertyAssertion('http://www.owl-ontologies.com/
> family.owl#name','http://www.owl-ontologies.com/
> family.owl#Person_1',literal(type('http://www.w3.org/2001/
> XMLSchema#string',Paul)))
>
> It is possible that they would be already in default, this way:
>
> name(Person_1,Paul).
note that these would need to be enclosed in quotes in prolog
try
save_axioms('my.pl',dlp,[no_base(_)]).
SWRL uses the JESS inference engine
, which uses two types of chaining rules, however, when you create the rules in SWRL in the protected environment, the rules are always forward chaining.
example, father (?x,?y) ^ father (?y,?z) -> grandfather (?x,?z)
I would like to find some way to create rules below, with some language for the semantic web.
grandfather(?x,?z)-> father (?x,?y) ^ father (?y,?z)
When you load an OWL file using Thea, it asserts the contents of the
OWL file as "facts" (closely resembling OWL abstract syntax). Look in
the file 'owl2_model.pl' to see what this looks like.You can directly
use these facts in prolog rules.
You probably want something like:
:- rdf_db:rdf_register_ns('namespacename',
'http://www.uriofyourontology.com/family.owl#').
grandfather (X, Y):-
rdf_global_id(namespacename:has_father, HasFatherURI),
propertyAssertion(HasFatherURI, X, Z),
propertyAssertion(HasFatherURI, Z, Y).
Cheers,
Jochem
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Jochem Liem, MSc.
Informatics Institute
Faculty of Science
University of Amsterdam
http://www.science.uva.nl/~jliem/
Phone: +31 (0)20 525 6801
Mobile: +31 (0)6 4321 9992
Fax: +31 (0)20 525 7490
Visitor address:
Science Park 904, C2.248
1098 XH Amsterdam
Mailing address:
Postbus 94323
1090 GH Amsterdam
The Netherlands
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Also note that your properties are not instantiated, so then can match
with any property.
In your code, you can construct the complete literal from NameX:
NameXLiteral =
literal(type('http://www.w3.org/2001/XMLSchema#string', NameX)
Then use NameXLiteral instead of NameX in your propertyAssertion line.
propertyAssertion(Name, X, NameX),
You should do the same for NameY.
~ Jochem