Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Ordered Collections. Fixes #112. #495

Merged
merged 14 commits into from
Jul 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/ReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ Release 10.0.0

- Renamed `MimeType` to `MediaType` to be consistent with [IANA guidelines](https://www.iana.org/assignments/media-types/media-types.xhtml)
and [RFC6838](https://tools.ietf.org/html/rfc6838). Issue [#434](<https://github.com/semanticarts/gist/issues/434>).
- Refactored ordered collection model. Issue [#112](<https://github.com/semanticarts/gist/issues/112>)
- Added predicate `gist:providesOrderFor`
- Deleted classes `gist:OrdinalCollection` and `gist:OrdinalMember`

daliadahleh marked this conversation as resolved.
Show resolved Hide resolved
### Minor Updates

Expand Down
118 changes: 58 additions & 60 deletions gistCore.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -1728,51 +1728,47 @@ gist:Offer
gist:OrderedCollection
a owl:Class ;
rdfs:subClassOf gist:Collection ;
owl:equivalentClass [
owl:intersectionOf (
gist:Collection
[
a owl:Restriction ;
owl:onProperty gist:hasOrderedMember ;
owl:someValuesFrom owl:Thing ;
]
) ;
] ;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The distinctionary pattern is written like this:

gist:OrderedCollection
	a owl:Class ;
	owl:equivalentClass [
		owl:intersectionOf (
			gist:Collection 
			[ 
				a owl:Restriction ;
				owl:onProperty gist:hasOrderedMember ;
				owl:someValuesFrom gist:OrderedMember ;
			]
		);
	] ;
	skos:definition "A collection where the members are in a fixed sequence."^^xsd:string ;
	skos:prefLabel "Ordered Collection"^^xsd:string ;

This expresses more clearly the idea that "An X is a type of Y that Z."

You also need an allValuesFrom restriction, so the full definition is:

gist:OrderedCollection
	a owl:Class ;
	owl:equivalentClass [
		owl:intersectionOf (
			gist:Collection 
			[ 
				a owl:Restriction ;
				owl:onProperty gist:hasOrderedMember ;
				owl:someValuesFrom gist:OrderedMember ;
			]
			[ 
				a owl:Restriction ;
				owl:onProperty gist:hasOrderedMember ;
				owl:allValuesFrom gist:OrderedMember ;
			]
		);
	] ;
	skos:definition "A collection where the members are in a fixed sequence."^^xsd:string ;
	skos:prefLabel "Ordered Collection"^^xsd:string ;

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rjyounes @daliadahleh Should we not remove the someValuesFrom? The allValueFrom enforces the object type on the property, and removing someValuesFrom allows for an empty collection.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@uschold and I discussed the possibility of empty sets and opened a new issue to raise the question: #498. In theory I'm in favor of allowing empty collections, but we noted that if we allow empty collections, then the restriction must also be removed from Collection (gist:hasMember some owl:Thing), which leaves it as a class without a formal definition.

skos:definition "A collection where the members are in a fixed sequence."^^xsd:string ;
skos:prefLabel "Ordered Collection"^^xsd:string ;
skos:scopeNote "Empty collections are not supported at this time."^^xsd:string ;
.

gist:OrdinalCollection
a owl:Class ;
rdfs:subClassOf
gist:OrderedCollection ,
[
a owl:Restriction ;
owl:onProperty gist:hasOrderedMember ;
owl:allValuesFrom gist:OrdinalMember ;
]
;
skos:definition "An Ordered Collection where no item can be of the same rank as any other item. In mathematical terms, this is a ?strict total order?."^^xsd:string ;
skos:prefLabel "Ordinal Collection"^^xsd:string ;
.

gist:OrdinalMember
gist:OrderedMember
a owl:Class ;
rdfs:subClassOf
gist:Category ,
[
a owl:Class ;
owl:unionOf (
[
a owl:Restriction ;
owl:onProperty gist:directlyPrecededBy ;
owl:someValuesFrom gist:OrdinalMember ;
]
[
a owl:Restriction ;
owl:onProperty gist:directlyPrecedes ;
owl:someValuesFrom gist:OrdinalMember ;
]
) ;
]
;
owl:equivalentClass [
a owl:Restriction ;
owl:onProperty gist:orderedMemberOf ;
owl:someValuesFrom gist:OrdinalCollection ;
rdfs:subClassOf [
a owl:Class ;
owl:unionOf (
[
a owl:Restriction ;
owl:onProperty gist:directlyPrecededBy ;
owl:someValuesFrom gist:OrderedMember ;
]
[
a owl:Restriction ;
owl:onProperty gist:directlyPrecedes ;
owl:someValuesFrom gist:OrderedMember ;
]
[
a owl:Restriction ;
owl:onProperty gist:sequence ;
owl:someValuesFrom xsd:integer ;
]
) ;
] ;
skos:definition "A member of an Ordinal Collection. It necessarily precedes or is preceded by another Ordinal Member in the same collection. (This last condition cannot be formally stated in OWL)."^^xsd:string ;
skos:prefLabel "Ordinal Member"^^xsd:string ;
skos:definition "A member of an ordered collection that serves as a proxy for a real world item, which can appear in different orders in different collections. The ordered member appears in exactly one ordered collection."^^xsd:string ;
skos:example "A person may rank 12th in the Boston Marathon but 29th in the New York City Marathon."^^xsd:string ;
skos:prefLabel "Ordered Member"^^xsd:string ;
skos:scopeNote "An ordered member points to the real world item via the providesOrderFor property. Ordering information is represented either as a number in a sequence, or by preceding or following another ordered member. The ordered collection is linked to the ordered member via the property hasOrderedMember."^^xsd:string ;
.

gist:Organization
Expand Down Expand Up @@ -3303,13 +3299,14 @@ gist:hasNavigationalParent

gist:hasOrderedMember
a
owl:InverseFunctionalProperty ,
owl:ObjectProperty
owl:ObjectProperty ,
owl:InverseFunctionalProperty
;
rdfs:subPropertyOf gist:hasMember ;
owl:inverseOf gist:orderedMemberOf ;
skos:definition "An inverse functional version of hasMember to ensure that no OrderedMember can be in more than one OrderedCollection., which can quickly lead to problems."^^xsd:string ;
rdfs:range gist:OrderedMember ;
skos:definition "Relates an ordered collection to an ordered member that belongs to it."^^xsd:string ;
skos:prefLabel "has ordered member"^^xsd:string ;
skos:scopeNote "This property is inverse functional because no ordered member can be in more than one ordered collection."^^xsd:string ;
.

gist:hasPart
Expand Down Expand Up @@ -3428,8 +3425,8 @@ gist:hasToNode

gist:hasUniqueNavigationalParent
a
owl:FunctionalProperty ,
owl:ObjectProperty
owl:ObjectProperty ,
owl:FunctionalProperty
;
rdfs:subPropertyOf gist:hasNavigationalParent ;
skos:definition "Used for taxos that must have single parents"^^xsd:string ;
Expand All @@ -3438,8 +3435,8 @@ gist:hasUniqueNavigationalParent

gist:hasUniqueSuperCategory
a
owl:FunctionalProperty ,
owl:ObjectProperty
owl:ObjectProperty ,
owl:FunctionalProperty
;
rdfs:subPropertyOf gist:hasSuperCategory ;
skos:definition "Used for taxos that must have single parents"^^xsd:string ;
Expand All @@ -3456,8 +3453,8 @@ gist:hasUoM

gist:identifiedBy
a
owl:InverseFunctionalProperty ,
owl:ObjectProperty
owl:ObjectProperty ,
owl:InverseFunctionalProperty
;
rdfs:range gist:ID ;
owl:inverseOf gist:identifies ;
Expand All @@ -3467,8 +3464,8 @@ gist:identifiedBy

gist:identifies
a
owl:FunctionalProperty ,
owl:ObjectProperty
owl:ObjectProperty ,
owl:FunctionalProperty
;
skos:definition "The thing the identifier refers to."^^xsd:string ;
skos:prefLabel "identifies"^^xsd:string ;
Expand Down Expand Up @@ -3602,15 +3599,6 @@ gist:offspringOf
skos:prefLabel "offspring of"^^xsd:string ;
.

gist:orderedMemberOf
a
owl:FunctionalProperty ,
owl:ObjectProperty
;
skos:definition "An inverse of hasOrderedMember"^^xsd:string ;
skos:prefLabel "ordered member of"^^xsd:string ;
.

gist:owns
a owl:ObjectProperty ;
rdfs:domain [
Expand Down Expand Up @@ -3708,6 +3696,16 @@ gist:produces
skos:prefLabel "produces"^^xsd:string ;
.

gist:providesOrderFor
a
owl:ObjectProperty ,
owl:FunctionalProperty
;
rdfs:domain gist:OrderedMember ;
skos:definition "Links a member of an ordered collection to the real-world item it represents in that collection."^^xsd:string ;
skos:prefLabel "provides order for"^^xsd:string ;
.

gist:rangeIncludes
a owl:AnnotationProperty ;
rdfs:subPropertyOf skos:scopeNote ;
Expand Down