Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

objectPropertyAssertion to support lists as Objects.

  • Loading branch information...
commit 0d0f6ee22e7539acc1616fe369fecae4676c8141 1 parent fa2578c
@vangelisv authored
View
13 owl2_from_rdf.pl
@@ -610,10 +610,13 @@
atom(C),
sub_atom(C,0,2,_,'__').
-% Table 11. Parsing Object Property Expressions
+ % Table 11. Parsing Object Property Expressions
owl_property_expression(C,C) :-
not(is_bnode(C)), % better: IRI(C).
+ % VV added 10/3/2011
+ not(C='http://www.w3.org/1999/02/22-rdf-syntax-ns#first'),
+ not(C='http://www.w3.org/1999/02/22-rdf-syntax-ns#rest'),
!.
owl_property_expression(C,D) :-
@@ -1236,7 +1239,7 @@
owl_description(C,CX).
dothislater(propertyAssertion/3).
-owl_parse_axiom(propertyAssertion(PX,A,B),AnnMode,List) :-
+owl_parse_axiom(propertyAssertion(PX,A,BX),AnnMode,List) :-
test_use_owl(A,P,B), % B can be literal or individual
P\='http://www.w3.org/1999/02/22-rdf-syntax-ns#type',
% note: some ontologies may include a triples with no
@@ -1244,8 +1247,10 @@
%property(P),
valid_axiom_annotation_mode(AnnMode,A,P,B,List),
\+ annotationProperty(P), % these triples should have been removed before, during ann parsing
- use_owl(A,P,B,propertyAssertion(PX,A,B)),
- owl_property_expression(P,PX). % can also be inverse
+ owl_property_expression(P,PX), % can also be inverse
+ % next line added by VV 9/3/2011 for Jochem Liem to support ID-lists as PA objects
+ ( owl_individual_list(B,BX) -> true ; BX = B),
+ use_owl(A,P,B,propertyAssertion(PX,A,BX)).
owl_parse_axiom(negativePropertyAssertion(PX,A,B),_,X) :-
View
75 testfiles/list-example.owl
@@ -0,0 +1,75 @@
+<?xml version="1.0"?>
+<rdf:RDF
+ xmlns="http://a.com/ontology#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
+ xmlns:owl="http://www.w3.org/2002/07/owl#"
+ xml:base="http://a.com/ontology">
+ <owl:Ontology rdf:about=""/>
+ <owl:Class rdf:ID="PersonList">
+ <rdfs:subClassOf rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#List"/>
+ <rdfs:subClassOf>
+ <owl:Restriction>
+ <owl:onProperty rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#first"/>
+ <owl:allValuesFrom>
+ <owl:Class rdf:ID="Person"/>
+ </owl:allValuesFrom>
+ </owl:Restriction>
+ </rdfs:subClassOf>
+ </owl:Class>
+ <owl:Class rdf:ID="Ranking"/>
+ <owl:ObjectProperty rdf:ID="persons">
+ <rdfs:domain rdf:resource="#Ranking"/>
+ <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#FunctionalProperty"/>
+ <rdfs:range rdf:resource="#PersonList"/>
+ </owl:ObjectProperty>
+ <owl:FunctionalProperty rdf:ID="listOfAnything">
+ <rdfs:domain rdf:resource="#Ranking"/>
+ <rdfs:range rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#List"/>
+ <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
+ </owl:FunctionalProperty>
+ <Person rdf:ID="ThirdPerson"/>
+ <Person rdf:ID="SecondPerson"/>
+ <Person rdf:ID="DuplicatePerson"/>
+ <Ranking rdf:ID="MyRanking">
+ <listOfAnything>
+ <rdf:List>
+ <rdf:rest>
+ <rdf:List>
+ <rdf:first rdf:resource="#SecondPerson"/>
+ </rdf:List>
+ </rdf:rest>
+ <rdf:first>
+ <Person rdf:ID="FirstPerson"/>
+ </rdf:first>
+ </rdf:List>
+ </listOfAnything>
+ <persons>
+ <PersonList>
+ <rdf:first rdf:resource="#FirstPerson"/>
+ <rdf:rest>
+ <PersonList>
+ <rdf:first rdf:resource="#SecondPerson"/>
+ <rdf:rest>
+ <PersonList>
+ <rdf:first rdf:resource="#ThirdPerson"/>
+ <rdf:rest>
+ <PersonList>
+ <rdf:first rdf:resource="#DuplicatePerson"/>
+ <rdf:rest>
+ <PersonList>
+ <rdf:first rdf:resource="#DuplicatePerson"/>
+ </PersonList>
+ </rdf:rest>
+ </PersonList>
+ </rdf:rest>
+ </PersonList>
+ </rdf:rest>
+ </PersonList>
+ </rdf:rest>
+ </PersonList>
+ </persons>
+ </Ranking>
+</rdf:RDF>
+
+<!-- Created with Protege (with OWL Plugin 1.1 beta, Build 107) http://protege.stanford.edu -->
View
8 testfiles/list_test.pl
@@ -0,0 +1,8 @@
+% :- assert(library_directory('C:/sw/development/pl')).
+:- use_module(library(thea2/owl2_model)).
+:- use_module(library(thea2/owl2_io)).
+
+%
+% rdf:List axiom
+%
+g :- load_axioms('list-example.owl').
Please sign in to comment.
Something went wrong with that request. Please try again.