@prefix ADMS: <http://www.w3.org/ns/adms#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix dlidentifiers: <https://concepts.datalad.org/s/identifiers/unreleased/> .
@prefix dltypes: <https://concepts.datalad.org/s/types/v1/> .
@prefix ns1: <http://purl.org/ontology/bibo/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix pav: <http://purl.org/pav/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix spdx: <http://spdx.org/rdf/terms#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

xsd:nonNegativeInteger a rdfs:Datatype ;
    owl:equivalentClass xsd:integer .

<https://concepts.datalad.org/s/identifiers/unreleased.owl.ttl> a owl:Ontology ;
    rdfs:label "identifiers-schema" ;
    dcterms:license "MIT" ;
    dcterms:title "Schema components to express identifiers of things" ;
    ns1:status <http://publications.europa.eu/resource/authority/concept-status/DEPRECATED> ;
    pav:version "UNRELEASED" ;
    skos:definition """This schema implements some aspects of the [identifier
concept](https://www.w3.org/TR/vocab-adms/#dt_identifier) of the [Asset
Description Metadata Schema](https://www.w3.org/TR/vocab-adms/#dt_identifier)
(ADMS). The provided [`identifiers` slot](identifiers) can be used to annotate
entities with identifiers with arbitrary scopes and issued by arbitrary agencies.

The schema also covered "content identifier" that are directly derived from
an entity ([`ComputedIdentifier`](ComputedIdentifier)), and a
[`Checksum`](Checksum) in particular.

This schema also incorporates the schema(s)

- [`types`](https://concepts.datalad.org/s/types/v1)

The schema definition is available as

- [JSON-LD context](../unreleased.context.jsonld)
- [LinkML YAML](../unreleased.yaml)
- [LinkML YAML (static/resolved)](../unreleased.static.yaml)
- [OWL TTL](../unreleased.owl.ttl)
- [SHACL TTL](../unreleased.shacl.ttl)
""" ;
    skos:note "ALL CONTENT HERE IS UNRELEASED AND MAY CHANGE ANY TIME" .

dlidentifiers:identifiers a owl:ObjectProperty ;
    rdfs:label "identifiers" ;
    rdfs:range dlidentifiers:Identifier ;
    skos:definition "An unambiguous reference to the subject within a given context." ;
    skos:exactMatch dcterms:identifier,
        <http://schema.org/identifier>,
        ADMS:identifier ;
    skos:inScheme <https://concepts.datalad.org/s/identifiers/unreleased> .

dltypes:EmailAddress a rdfs:Datatype ;
    owl:equivalentClass [ a rdfs:Datatype ;
            owl:intersectionOf ( xsd:string [ a rdfs:Datatype ;
                        owl:onDatatype xsd:string ;
                        owl:withRestrictions ( [ xsd:pattern "(?:[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?\\.)+[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?|\\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[A-Za-z0-9-]*[A-Za-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])" ] ) ] ) ] .

xsd:hexBinary a rdfs:Datatype ;
    owl:equivalentClass [ a rdfs:Datatype ;
            owl:intersectionOf ( xsd:string [ a rdfs:Datatype ;
                        owl:onDatatype xsd:string ;
                        owl:withRestrictions ( [ xsd:pattern "^[a-fA-F0-9]+$" ] ) ] ) ] .

rdfs:Resource a rdfs:Datatype ;
    owl:equivalentClass xsd:anyURI .

dlidentifiers:Checksum a owl:Class ;
    rdfs:label "Checksum" ;
    rdfs:subClassOf [ a owl:Restriction ;
            owl:minCardinality 1 ;
            owl:onProperty dlidentifiers:creator ],
        [ a owl:Restriction ;
            owl:minCardinality 1 ;
            owl:onProperty dlidentifiers:notation ],
        [ a owl:Restriction ;
            owl:allValuesFrom xsd:hexBinary ;
            owl:onProperty dlidentifiers:notation ],
        [ a owl:Restriction ;
            owl:maxCardinality 1 ;
            owl:onProperty dlidentifiers:creator ],
        [ a owl:Restriction ;
            owl:maxCardinality 1 ;
            owl:onProperty dlidentifiers:notation ],
        [ a owl:Restriction ;
            owl:allValuesFrom owl:Thing ;
            owl:onProperty dlidentifiers:creator ],
        dlidentifiers:ComputedIdentifier ;
    skos:definition "A Checksum is a value that allows to check the integrity of the contents of a file. Even small changes to the content of the file will change its checksum. This class allows the results of a variety of checksum and cryptographic message digest algorithms to be represented." ;
    skos:exactMatch spdx:Checksum,
        dlidentifiers:Checksum ;
    skos:inScheme <https://concepts.datalad.org/s/identifiers/unreleased> .

dlidentifiers:DOI a owl:Class ;
    rdfs:label "DOI" ;
    rdfs:subClassOf [ a owl:Restriction ;
            owl:maxCardinality 1 ;
            owl:onProperty dlidentifiers:creator ],
        [ a owl:Restriction ;
            owl:allValuesFrom owl:Thing ;
            owl:onProperty dlidentifiers:creator ],
        [ a owl:Restriction ;
            owl:allValuesFrom [ a rdfs:Datatype ;
                    owl:onDatatype xsd:string ;
                    owl:withRestrictions ( [ xsd:pattern "(?i)^(?!(?:https?://|doi:)).+$" ] ) ] ;
            owl:onProperty dlidentifiers:notation ],
        [ a owl:Restriction ;
            owl:minCardinality 0 ;
            owl:onProperty dlidentifiers:creator ],
        [ a owl:Restriction ;
            owl:minCardinality 0 ;
            owl:onProperty dlidentifiers:notation ],
        [ a owl:Restriction ;
            owl:minCardinality 0 ;
            owl:onProperty dlidentifiers:schema_agency ],
        [ a owl:Restriction ;
            owl:maxCardinality 1 ;
            owl:onProperty dlidentifiers:notation ],
        [ a owl:Restriction ;
            owl:maxCardinality 1 ;
            owl:onProperty dlidentifiers:schema_agency ],
        [ a owl:Restriction ;
            owl:allValuesFrom owl:Thing ;
            owl:onProperty dlidentifiers:schema_agency ],
        dlidentifiers:IssuedIdentifier ;
    owl:hasKey ( dlidentifiers:notation ) ;
    skos:definition "Digital Object Identifier (DOI; ISO 26324), an identifier system governed by the DOI Foundation, where individual identifiers are issued by one of several registration agencies." ;
    skos:exactMatch dlidentifiers:DOI ;
    skos:inScheme <https://concepts.datalad.org/s/identifiers/unreleased> .

dlidentifiers:ComputedIdentifier a owl:Class ;
    rdfs:label "ComputedIdentifier" ;
    rdfs:subClassOf dlidentifiers:Identifier ;
    skos:definition "An identifier that has been derived from information on the identified entity." ;
    skos:exactMatch dlidentifiers:ComputedIdentifier ;
    skos:inScheme <https://concepts.datalad.org/s/identifiers/unreleased> ;
    skos:narrowMatch spdx:Checksum .

dlidentifiers:IssuedIdentifier a owl:Class ;
    rdfs:label "IssuedIdentifier" ;
    rdfs:seeAlso <https://semiceu.github.io/ADMS/releases/2.00/#Identifier> ;
    rdfs:subClassOf [ a owl:Restriction ;
            owl:allValuesFrom xsd:string ;
            owl:onProperty dlidentifiers:schema_agency ],
        [ a owl:Restriction ;
            owl:maxCardinality 1 ;
            owl:onProperty dlidentifiers:schema_agency ],
        [ a owl:Restriction ;
            owl:minCardinality 0 ;
            owl:onProperty dlidentifiers:schema_agency ],
        dlidentifiers:Identifier ;
    skos:definition "An identifier that was issued by a particular agent with a notation that has no (or an undefined) relation to the nature of the identified entity." ;
    skos:exactMatch ADMS:Identifier,
        dlidentifiers:IssuedIdentifier ;
    skos:inScheme <https://concepts.datalad.org/s/identifiers/unreleased> .

dlidentifiers:Identifier a owl:Class ;
    rdfs:label "Identifier" ;
    rdfs:subClassOf [ a owl:Restriction ;
            owl:maxCardinality 1 ;
            owl:onProperty dlidentifiers:creator ],
        [ a owl:Restriction ;
            owl:minCardinality 1 ;
            owl:onProperty dlidentifiers:notation ],
        [ a owl:Restriction ;
            owl:allValuesFrom xsd:string ;
            owl:onProperty dlidentifiers:notation ],
        [ a owl:Restriction ;
            owl:allValuesFrom rdfs:Resource ;
            owl:onProperty dltypes:schema_type ],
        [ a owl:Restriction ;
            owl:allValuesFrom xsd:anyURI ;
            owl:onProperty dlidentifiers:creator ],
        [ a owl:Restriction ;
            owl:maxCardinality 1 ;
            owl:onProperty dlidentifiers:notation ],
        [ a owl:Restriction ;
            owl:maxCardinality 1 ;
            owl:onProperty dltypes:schema_type ],
        [ a owl:Restriction ;
            owl:minCardinality 0 ;
            owl:onProperty dltypes:schema_type ],
        [ a owl:Restriction ;
            owl:minCardinality 0 ;
            owl:onProperty dlidentifiers:creator ] ;
    skos:closeMatch ADMS:Identifier ;
    skos:definition "An identifier is a label that uniquely identifies an item in a particular context. Some identifiers are globally unique. All identifiers are unique within their individual scope." ;
    skos:exactMatch dlidentifiers:Identifier ;
    skos:inScheme <https://concepts.datalad.org/s/identifiers/unreleased> .

dlidentifiers:schema_agency a owl:DatatypeProperty ;
    rdfs:label "schema_agency" ;
    rdfs:range xsd:string ;
    skos:definition "Name of the agency that issued an identifier." ;
    skos:exactMatch ADMS:schemaAgency ;
    skos:inScheme <https://concepts.datalad.org/s/identifiers/unreleased> .

dltypes:schema_type a owl:DatatypeProperty ;
    rdfs:label "schema_type" ;
    rdfs:range rdfs:Resource ;
    skos:definition "State that the subject is an instance of a particular schema class. Typically, no explicit value needs to be assigned to this slot, because it matches the class type of a particular record. However, this slots can be used as a type designator of a schema element for validation and schema structure handling purposes. This is used to indicate specialized schema classes for properties that accept a hierarchy of classes as their range." ;
    skos:exactMatch dcterms:type ;
    skos:inScheme <https://concepts.datalad.org/s/types/v1> .

dlidentifiers:creator a owl:DatatypeProperty ;
    rdfs:label "creator" ;
    rdfs:range xsd:anyURI ;
    skos:definition "An agent responsible for making an entity." ;
    skos:editorialNote "The `range` is only `uriorcurie` here (and not `Thing`), because we have an `ifabsent` declaration for DOIs that only work with this type. And even for that it needs a patch." ;
    skos:exactMatch dcterms:creator ;
    skos:inScheme <https://concepts.datalad.org/s/identifiers/unreleased> .

dlidentifiers:notation a owl:DatatypeProperty ;
    rdfs:label "notation" ;
    rdfs:range xsd:string ;
    skos:definition "String of characters such as \"T58:5\" or \"30:4833\" used to uniquely identify a concept within the scope of a given concept scheme." ;
    skos:exactMatch skos:notation ;
    skos:inScheme <https://concepts.datalad.org/s/identifiers/unreleased> .

[] a owl:Restriction ;
    rdfs:subClassOf dlidentifiers:Identifier ;
    owl:onProperty dltypes:schema_type ;
    owl:someValuesFrom dlidentifiers:Identifier .

[] a owl:Restriction ;
    rdfs:subClassOf dlidentifiers:IssuedIdentifier ;
    owl:onProperty dltypes:schema_type ;
    owl:someValuesFrom dlidentifiers:IssuedIdentifier .

[] a owl:Restriction ;
    rdfs:subClassOf dlidentifiers:Checksum ;
    owl:onProperty dltypes:schema_type ;
    owl:someValuesFrom dlidentifiers:Checksum .

[] a owl:Restriction ;
    rdfs:subClassOf dlidentifiers:DOI ;
    owl:onProperty dltypes:schema_type ;
    owl:someValuesFrom dlidentifiers:DOI .

[] a owl:Restriction ;
    rdfs:subClassOf dlidentifiers:ComputedIdentifier ;
    owl:onProperty dltypes:schema_type ;
    owl:someValuesFrom dlidentifiers:ComputedIdentifier .


