There are probably several ways to do this, depending on your implementation preferences. My advice is to use rdf:li special property instead of an arbitrary rdf:_nnn , which is easier to extend. rdf:li equivalent to rdf:_1 , rdf:_2 in order. Thus, the following code blocks are equivalent:
:mySeq a rdf:Seq; rdf:_1 :foo; rdf:_2 :bar . :mySeq a rdf:Seq; rdf:li :foo; rdf:li :bar .
Please note that the order in the second block is significant.
To accomplish what you are asking, you can extend rdf:li with a new property and refine its domain / range (although they really make sense to readers, since the child property inherits the semantics of the parent):
:myItem rdfs:subPropertyOf rdf:li; rdfs:range :typeOfElement; rdfs:domain :mySeq .
:myItem inherits the semantics of rdf:li , so any implementation logic you have can conclude that the values :myItem are in some meaningful order. Next, define the class :mySeq through a property constraint:
:mySeq rdfs:subClassOf [ a owl:Restriction; owl:onProperty :myItem; owl:allValuesFrom :typeOfElement;].
which claims that :mySeq is a class of all things, where the :myItem property :myItem explicitly used for :typeOfElement values. Now you can create lists with :mySeq .
To take another step, you can define :mySeq as the intersection of the above rule and rdf:Seq :
:mySeq a owl:Class; owl:equivalentClass [ a owl:Class; owl:intersectionOf ( rdf:Seq [a owl:Restriction; owl:onProperty :myItem; owl:allValuesFrom :typeOfElement ]) ] .
Note the use of owl:equivalentClass instead of rdfs:subClassOf . If we consider owl:equivalentClass as symmetric and substitute it under rdfs:subClassOf , for example:
owl:equivalentClass a owl:SymmetricProperty . owl:equivalentClass rdfs:subPropertyOf rdfs:subClassOf .
then we can have equivalence that goes both ways. Therefore, all rdf:Seq instances whose values ββfor :myItem have :typeOfElement are also :mySeq . In this case, you infer the type. So, through the instructions:
:xa rdf:Seq; :myItem :foo, :bar .
you can conclude that :xa :mySeq .