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

Change observable:mimeType to Object Property #377

Draft
wants to merge 8 commits into
base: develop
Choose a base branch
from
Draft
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
11 changes: 11 additions & 0 deletions ontology/uco/core/core.ttl
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
# imports: http://www.w3.org/TR/skos-reference/skos-owl1-dl.rdf

@prefix core: <https://ontology.unifiedcyberontology.org/uco/core/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix types: <https://ontology.unifiedcyberontology.org/uco/types/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

<https://ontology.unifiedcyberontology.org/uco/core>
a owl:Ontology ;
rdfs:label "uco-core"@en ;
rdfs:comment "This ontology defines classes and properties that are shared across the various UCO ontologies. At a high-level, the UCO core ontology provides base classes, relationship-oriented classes, content-aggregation classes, and shared classes."@en ;
owl:imports <http://www.w3.org/TR/skos-reference/skos-owl1-dl.rdf> ;
.

core:Annotation
Expand Down Expand Up @@ -317,6 +321,13 @@ core:Relationship
sh:targetClass core:Relationship ;
.

core:TaxonomicConcept
a owl:Class ;
rdfs:subClassOf skos:Concept ;
rdfs:label "TaxonomicConcept"@en ;
rdfs:comment "Taxonomic Concept is a mix-in class that enables UCO as an OWL ontology to use SKOS taxonomic individuals. [based on https://www.w3.org/2006/07/SWD/SKOS/skos-and-owl/master.html#Hybrids]"@en ;
.

core:UcoObject
a
owl:Class ,
Expand Down
2 changes: 2 additions & 0 deletions ontology/uco/master/uco.ttl
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# imports: http://www.w3.org/TR/skos-reference/skos-owl1-dl.rdf
# imports: https://ontology.unifiedcyberontology.org/co
# imports: https://ontology.unifiedcyberontology.org/owl
# imports: https://ontology.unifiedcyberontology.org/uco/action
Expand Down Expand Up @@ -26,6 +27,7 @@
a owl:Ontology ;
rdfs:label "uco-master"@en ;
owl:imports
<http://www.w3.org/TR/skos-reference/skos-owl1-dl.rdf> ,
<https://ontology.unifiedcyberontology.org/co> ,
<https://ontology.unifiedcyberontology.org/owl> ,
<https://ontology.unifiedcyberontology.org/uco/action> ,
Expand Down
45 changes: 37 additions & 8 deletions ontology/uco/observable/observable.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@
@prefix action: <https://ontology.unifiedcyberontology.org/uco/action/> .
@prefix co: <http://purl.org/co/> .
@prefix core: <https://ontology.unifiedcyberontology.org/uco/core/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix identity: <https://ontology.unifiedcyberontology.org/uco/identity/> .
@prefix location: <https://ontology.unifiedcyberontology.org/uco/location/> .
@prefix observable: <https://ontology.unifiedcyberontology.org/uco/observable/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix types: <https://ontology.unifiedcyberontology.org/uco/types/> .
@prefix vocabulary: <https://ontology.unifiedcyberontology.org/uco/vocabulary/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
Expand Down Expand Up @@ -1749,6 +1751,11 @@ observable:ContentDataFacet
rdfs:label "ContentDataFacet"@en ;
rdfs:comment "A content data facet is a grouping of characteristics unique to a block of digital data."@en ;
sh:property
[
sh:class dcterms:FileFormat ;
sh:nodeKind sh:IRI ;
sh:path observable:mimeType ;
] ,
[
sh:class observable:ObservableObject ;
sh:maxCount "1"^^xsd:integer ;
Expand Down Expand Up @@ -1796,11 +1803,6 @@ observable:ContentDataFacet
sh:nodeKind sh:Literal ;
sh:path observable:mimeClass ;
] ,
[
sh:datatype xsd:string ;
sh:nodeKind sh:Literal ;
sh:path observable:mimeType ;
] ,
[
sh:datatype vocabulary:EndiannessTypeVocab ;
sh:message "Value is outside the default vocabulary EndiannessTypeVocab." ;
Expand Down Expand Up @@ -10964,10 +10966,37 @@ observable:mimeClass
.

observable:mimeType
a owl:DatatypeProperty ;
a owl:ObjectProperty ;
rdfs:label "mimeType"@en ;
rdfs:comment "MIME type of the data. For example 'text/html' or 'audio/mp3'."@en ;
rdfs:range xsd:string ;
rdfs:comment "MIME type of the data. The text form of '${type}/${subtype}' (for example, 'text/html' or 'audio/mp3') can be used to find a UCO-provisioned set of types from the UCO Media Types Taxonomy. For interoperability with non-UCO resources, dcterms:FileFormat is this property's required range. The more-specific UCO classes types:IANAMediaType or types:NonIANAMediaType should be used when available."@en ;
rdfs:range dcterms:FileFormat ;
rdfs:seeAlso
types:IANAMediaType ,
types:NonIANAMediaType ,
<https://taxonomy.unifiedcyberontology.org/uco/mime/>
;
.

observable:mimeType-class-types-MIMEFormat
a sh:PropertyShape ;
rdfs:comment "This shape is given an IRI in order to facilitate deactivation on request."@en ;
rdfs:seeAlso sh:deactivated ;
sh:class types:MIMEFormat ;
sh:message "Value is not an instance of types:MIMEFormat or one of its subclasses. Please consider using a value having type types:IANAMediaType or types:NonIANAMediaType."@en ;
sh:path observable:mimeType ;
sh:severity sh:Info ;
sh:targetSubjectsOf observable:mimeType ;
.

observable:mimeType-notation
a sh:PropertyShape ;
rdfs:comment "This shape is intended to be deactivated by using overriding shapes in the UCO Mime Taxonomy."@en ;
rdfs:seeAlso <https://taxonomy.unifiedcyberontology.org/uco/mime/> ;
sh:message "The used mimeType value is not a concept with a skos:notation. Some consumers of this data expect a string with the MIME 'type/subtype' format to be supplied with skos:notation. Please either add the skos:notation to your input graph or incorporate the UCO MIME Taxonomy."@en ;
sh:minCount "1"^^xsd:integer ;
sh:path skos:notation ;
sh:severity sh:Warning ;
sh:targetObjectsOf observable:mimeType ;
.

observable:minorImageVersion
Expand Down
32 changes: 32 additions & 0 deletions ontology/uco/types/types.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

@prefix co: <http://purl.org/co/> .
@prefix core: <https://ontology.unifiedcyberontology.org/uco/core/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix observable: <https://ontology.unifiedcyberontology.org/uco/observable/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
Expand All @@ -22,6 +24,11 @@
;
.

dcterms:FileFormat
a owl:Class ;
rdfs:comment "UCO extends dcterms:FileFormat to be an OWL Class in addition to its native definition of an RDF Class."@en ;
.

types:ControlledDictionary
a
owl:Class ,
Expand Down Expand Up @@ -167,16 +174,41 @@ types:Hash
sh:targetClass types:Hash ;
.

types:IANAMediaType
a owl:Class ;
rdfs:subClassOf types:MIMEFormat ;
rdfs:label "IANAMediaType"@en ;
owl:disjointWith types:NonIANAMediaType ;
.

types:Identifier
a rdfs:Datatype ;
rdfs:comment "An identifier is a string conformant to the specified UUID-based format for UCO object identifiers."@en ;
.

types:MIMEFormat
a owl:Class ;
rdfs:subClassOf
dcterms:FileFormat ,
core:TaxonomicConcept
;
rdfs:label "MIMEFormat"@en ;
rdfs:comment "This class should be considered an intermediary, 'abstract' class, and should not have individuals defined that are not a member of one of its subclasses. This class has two purposes. First, to encode for interoperability with existing frameworks, without relying on RDFS inference, that a UCO MIMEFormat individual is both a SKOS Concept (via core:TaxonomicConcept) and Dublin Core Terms FileFormat. Second, to guarantee a concept to be used as a UCO MIME type has exactly one skos:notation. Note that strict SHACL enforcement of the skos:notation presence is not within the UCO Types ontology, but is instead a part of the shapes provided by the UCO MIME Taxonomy. The warning about skos:notation in the Observable namespace is deactivated on importing the taxonomy's shapes."@en ;
rdfs:seeAlso observable:mimeType-notation ;
.

types:NativeFormatString
a rdfs:Datatype ;
rdfs:comment "Specifies data in its native format of some external language. The data may be encoded in Base64 per [RFC4648]. Data encoded in Base64 must be denoted as such using the encoded property."@en ;
.

types:NonIANAMediaType
a owl:Class ;
rdfs:subClassOf types:MIMEFormat ;
rdfs:label "NonIANAMediaType"@en ;
owl:disjointWith types:IANAMediaType ;
.

types:StructuredText
a rdfs:Datatype ;
rdfs:comment "Expresses string-based data in some information structuring format (e.g., HTML5)."@en ;
Expand Down
6 changes: 6 additions & 0 deletions tests/examples/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ all: \
location_XFAIL_validation.ttl \
message_thread_PASS_validation.ttl \
message_thread_XFAIL_validation.ttl \
mime_PASS_validation.ttl \
mime_XFAIL_validation.ttl \
mime_prefix_PASS_validation.ttl \
owl_axiom_PASS_validation.ttl \
owl_axiom_XFAIL_validation.ttl \
owl_properties_PASS_validation.ttl \
Expand Down Expand Up @@ -90,6 +93,9 @@ check: \
location_XFAIL_validation.ttl \
message_thread_PASS_validation.ttl \
message_thread_XFAIL_validation.ttl \
mime_PASS_validation.ttl \
mime_XFAIL_validation.ttl \
mime_prefix_PASS_validation.ttl \
owl_axiom_PASS_validation.ttl \
owl_axiom_XFAIL_validation.ttl \
owl_properties_PASS_validation.ttl \
Expand Down
152 changes: 152 additions & 0 deletions tests/examples/mime_PASS.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
{
"@context": {
"core": "https://ontology.unifiedcyberontology.org/uco/core/",
"dcterms": "http://purl.org/dc/terms/",
"kb": "http://example.org/kb/",
"observable": "https://ontology.unifiedcyberontology.org/uco/observable/",
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
"skos": "http://www.w3.org/2004/02/skos/core#",
"types": "https://ontology.unifiedcyberontology.org/uco/types/"
},
"@graph": [
{
"@id": "urn:example:mime:dcterms:application/gzip",
"@type": "dcterms:FileFormat",
"rdfs:comment": "This is a custom media type individual, designed for just this unit test. A larger taxonomy of individuals should be used outside of testing contexts.",
"skos:notation": "application/gzip"
},
{
"@id": "urn:example:mime:uco:application/gzip",
"@type": "types:IANAMediaType",
"rdfs:comment": "This is a custom media type individual, designed for just this unit test. A larger taxonomy of individuals should be used outside of testing contexts.",
"skos:exactMatch": {
"@id": "urn:example:mime:dcterms:application/gzip"
},
"skos:notation": "application/gzip"
},
{
"@id": "urn:example:mime:uco:application/tar",
"@type": "types:NonIANAMediaType",
"rdfs:comment": "This is a custom media type individual, designed for just this unit test. A larger taxonomy of individuals should be used outside of testing contexts.",
"skos:notation": "application/tar"
},
{
"@id": "urn:example:mime:uco:application/tar+gzip",
"@type": "types:NonIANAMediaType",
"rdfs:comment": "This is a custom media type individual, designed for just this unit test. A larger taxonomy of individuals should be used outside of testing contexts.",
"skos:broader": [
{
"@id": "urn:example:mime:uco:application/gzip"
},
{
"@id": "urn:example:mime:uco:application/tar"
}
],
"skos:notation": "application/tar+gzip"
},
{
"@id": "urn:example:mime:uco:image/example.image.type.without.notation",
"@type": "types:NonIANAMediaType",
"rdfs:comment": "This is a custom media type individual, designed for just this unit test. A larger taxonomy of individuals should be used outside of testing contexts."
},
{
"@id": "kb:file-1",
"@type": "observable:File",
"core:hasFacet": [
{
"@type": "observable:ContentDataFacet",
"observable:mimeType": {
"@id": "urn:example:mime:dcterms:application/gzip"
}
},
{
"@type": "observable:FileFacet",
"observable:fileName": "1.gz"
}
],
"rdfs:comment": "This file node should trigger an sh:Info-severity result."
},
{
"@id": "kb:file-2",
"@type": "observable:File",
"core:hasFacet": [
{
"@type": "observable:ContentDataFacet",
"observable:mimeType": {
"@id": "urn:example:mime:uco:application/gzip"
}
},
{
"@type": "observable:FileFacet",
"observable:fileName": "2.gz"
}
]
},
{
"@id": "kb:file-3",
"@type": "observable:File",
"core:hasFacet": [
{
"@type": "observable:ContentDataFacet",
"observable:mimeType": {
"@id": "urn:example:mime:uco:application/tar"
}
},
{
"@type": "observable:FileFacet",
"observable:fileName": "3.tar"
}
]
},
{
"@id": "kb:file-4",
"@type": "observable:File",
"core:hasFacet": [
{
"@type": "observable:ContentDataFacet",
"observable:mimeType": {
"@id": "urn:example:mime:uco:application/tar+gzip"
}
},
{
"@type": "observable:FileFacet",
"observable:fileName": "4.tar.gz"
}
]
},
{
"@id": "kb:file-5",
"@type": "observable:File",
"core:hasFacet": [
{
"@type": "observable:ContentDataFacet",
"observable:mimeType": {
"@id": "urn:example:mime:uco:image/example.image.type.without.notation"
}
},
{
"@type": "observable:FileFacet",
"observable:fileName": "5.dat"
}
],
"rdfs:comment": "This file node should trigger an sh:Warning-severity result."
},
{
"@id": "kb:file-6",
"@type": "observable:File",
"core:hasFacet": [
{
"@type": "observable:ContentDataFacet",
"observable:mimeType": {
"@id": "urn:example:mime:uco:image/example.image.type.without.notation"
}
},
{
"@type": "observable:FileFacet",
"observable:fileName": "6.dat"
}
],
"rdfs:comment": "This file node should trigger an sh:Warning-severity result."
}
]
}
Loading