# # mim:ObjectType # PREFIX rdfs: PREFIX owl: PREFIX sh: PREFIX mim: INSERT { GRAPH { ?objecttype a mim:Objecttype. ?objecttype rdfs:seeAlso ?nodeshape. } } WHERE { GRAPH { SELECT (iri(replace(str(?nodeshape),"[#|/]([a-zA-Z0-9_-]+$)","-mim#$1")) as ?objecttype) ?nodeshape WHERE { ?nodeshape a sh:NodeShape. ?nodeshape sh:targetClass ?class. FILTER isIRI(?nodeshape) } } } # # mim:Attribuutsoort # PREFIX rdfs: PREFIX owl: PREFIX sh: PREFIX mim: INSERT { GRAPH { ?objecttype mim:attribuut ?attribuutsoort. ?attribuutsoort a mim:Attribuutsoort. ?attribuutsoort rdfs:seeAlso ?propertyshape. } } WHERE { GRAPH { ?objecttype a mim:Objecttype. ?objecttype rdfs:seeAlso ?shape } GRAPH { { select (iri(replace(str(?propertyshape),"[#|/]([a-zA-Z0-9_-]+$)","-mim#$1")) as ?attribuutsoort) ?shape ?propertyshape where { ?shape a sh:NodeShape. ?shape sh:property ?propertyshape. ?propertyshape ?link ?datatype. FILTER isIRI(?propertyshape) FILTER (?link = sh:datatype || ?link = sh:node) } } UNION { select (iri(concat(replace(str(?shape),"[#|/]([a-zA-Z0-9_-]+$)","-mim#$1"),".",?pname)) as ?attribuutsoort) ?shape ?propertyshape where { ?shape a sh:NodeShape. ?shape sh:property ?propertyshape. ?propertyshape ?link ?datatype. ?propertyshape sh:name ?pname. FILTER isBlank(?propertyshape) FILTER (?link = sh:datatype || ?link = sh:node) } } } } # # mim:Relatiesoort # PREFIX rdfs: PREFIX owl: PREFIX sh: PREFIX mim: INSERT { GRAPH { ?relatiesoort a mim:Relatiesoort. ?relatiesoort rdfs:seeAlso ?propertyshape. ?relatiesoort mim:bron ?objecttype. } } WHERE { GRAPH { ?objecttype a mim:Objecttype. ?objecttype rdfs:seeAlso ?shape } GRAPH { { select (iri(replace(str(?propertyshape),"[#|/]([a-zA-Z0-9_-]+$)","-mim#$1")) as ?relatiesoort) ?shape ?propertyshape where { ?shape a sh:NodeShape. ?shape sh:property ?propertyshape. ?propertyshape sh:class ?class. FILTER isIRI(?propertyshape) } } UNION { select (iri(concat(replace(str(?shape),"[#|/]([a-zA-Z0-9_-]+$)","-mim#$1"),".",?pname)) as ?relatiesoort) ?shape ?propertyshape where { ?shape a sh:NodeShape. ?shape sh:property ?propertyshape. ?propertyshape sh:class ?class. ?propertyshape sh:name ?pname. FILTER isBlank(?propertyshape) } } } } # # mim:GestructureerdDatatype # PREFIX rdfs: PREFIX owl: PREFIX sh: PREFIX mim: INSERT { GRAPH { ?datatype a mim:GestructureerdDatatype. ?datatype rdfs:seeAlso ?nodeshape. } } WHERE { GRAPH { SELECT (iri(replace(str(?nodeshape),"[#|/]([a-zA-Z0-9_-]+$)","-mim#$1")) as ?datatype) ?nodeshape WHERE { ?nodeshape a sh:NodeShape. FILTER NOT EXISTS {?nodeshape sh:targetClass ?class} FILTER NOT EXISTS { ?nodeshape sh:property ?schemeproperty. ?schemeproperty sh:path skos:inScheme. ?schemeproperty sh:hasValue ?scheme. } FILTER NOT EXISTS { ?nodeshape sh:property ?collectionproperty. ?collectionproperty sh:path/sh:inversePath skos:member. ?collectionproperty sh:hasValue ?collection. } FILTER isIRI(?nodeshape) } } } # # mim:Referentielijst # PREFIX rdfs: PREFIX owl: PREFIX sh: PREFIX mim: INSERT { GRAPH { ?referentielijst a mim:Referentielijst. ?referentielijst rdfs:seeAlso ?nodeshape. } } WHERE { GRAPH { { SELECT (iri(replace(str(?nodeshape),"[#|/]([a-zA-Z0-9_-]+$)","-mim#$1")) as ?referentielijst) ?nodeshape WHERE { ?nodeshape a sh:NodeShape. FILTER NOT EXISTS {?nodeshape sh:targetClass ?class} ?nodeshape sh:property ?schemeproperty. ?schemeproperty sh:path skos:inScheme. ?schemeproperty sh:hasValue ?scheme. FILTER isIRI(?nodeshape) } } UNION { SELECT (iri(replace(str(?nodeshape),"[#|/]([a-zA-Z0-9_-]+$)","-mim#$1")) as ?referentielijst) ?nodeshape WHERE { ?nodeshape a sh:NodeShape. FILTER NOT EXISTS {?nodeshape sh:targetClass ?class} ?nodeshape sh:property ?collectionproperty. ?collectionproperty sh:path/sh:inversePath skos:member. ?collectionproperty sh:hasValue ?collection. FILTER isIRI(?nodeshape) } } } } # # mim:Generalisatie # PREFIX rdfs: PREFIX owl: PREFIX sh: PREFIX mim: INSERT { GRAPH { ?generalisatie a mim:Generalisatie. ?generalisatie mim:subtype ?subtype. ?generalisatie mim:supertype ?supertype. } } WHERE { GRAPH { SELECT (iri(concat(replace(str(?subject),"[#|/]([a-zA-Z0-9_-]+$)","-mim#$1"),"---",replace(str(?object),"^.*[#|/]([a-zA-Z0-9_-]+$)","$1"))) as ?generalisatie) ?subject ?subshape ?objshape WHERE { ?subject rdfs:subClassOf ?object. ?subshape sh:targetClass ?subject. ?objshape sh:targetClass ?object. } } GRAPH { ?subtype rdfs:seeAlso ?subshape. ?supertype rdfs:seeAlso ?objshape. } } # # default datatypes"; # PREFIX rdfs: PREFIX owl: PREFIX sh: PREFIX mim: PREFIX xsd: INSERT { GRAPH { mim:CharacterString rdfs:seeAlso xsd:string. mim:Integer rdfs:seeAlso xsd:integer. mim:Real rdfs:seeAlso xsd:decimal. mim:Boolean rdfs:seeAlso xsd:boolean. mim:Date rdfs:seeAlso xsd:date. mim:DateTime rdfs:seeAlso xsd:dateTime. mim:Year rdfs:seeAlso xsd:gYear. mim:Day rdfs:seeAlso xsd:gDay. mim:Month rdfs:seeAlso xsd:gMonth. mim:URI rdfs:seeAlso xsd:AnyURI. } } WHERE {} # # mim:name # PREFIX rdfs: PREFIX owl: PREFIX sh: PREFIX mim: INSERT { GRAPH { ?element mim:naam ?naam } } WHERE { GRAPH { ?element rdfs:seeAlso ?item } GRAPH { { ?item rdfs:label ?naam } UNION { ?item sh:name ?naam FILTER NOT EXISTS {?item rdfs:label ?label} } UNION { ?item (sh:targetClass|sh:path) ?vocterm. ?vocterm rdfs:label ?naam FILTER NOT EXISTS {?item rdfs:label ?label} FILTER NOT EXISTS {?item sh:name ?namelabel} } } } # # mim:alias # PREFIX rdfs: PREFIX owl: PREFIX sh: PREFIX mim: INSERT { GRAPH { ?element mim:alias ?alias } } WHERE { GRAPH { ?element rdfs:seeAlso ?item } GRAPH { { ?item skos:altLabel ?alias } UNION { ?item sh:name ?alias. ?item rdfs:label ?naam } } } # # mim:begrip # PREFIX rdfs: PREFIX owl: PREFIX sh: PREFIX mim: PREFIX dct: INSERT { GRAPH { ?element mim:begrip ?begrip } } WHERE { GRAPH { ?element rdfs:seeAlso ?item } GRAPH { { ?item dct:subject ?begrip } UNION { ?item sh:targetClass ?class. ?class dct:subject ?begrip } } } # # mim:definitie # PREFIX rdfs: PREFIX owl: PREFIX sh: PREFIX mim: PREFIX dct: INSERT { GRAPH { ?element mim:definitie ?definitie } } WHERE { GRAPH { ?element rdfs:seeAlso ?item } GRAPH { { ?item rdfs:comment ?definitie } UNION { ?item sh:targetClass ?class. ?class rdfs:comment ?definitie } } } # # mim:kardinaliteit # PREFIX rdfs: PREFIX owl: PREFIX sh: PREFIX mim: PREFIX dct: INSERT { GRAPH { ?element mim:kardinaliteit ?kardinaliteit } } WHERE { GRAPH { ?element rdfs:seeAlso ?propertyshape } GRAPH { select ?propertyshape (concat(if(bound(?min),str(?min),if(bound(?max),"0","")),if(bound(?max),if(bound(?min),if(?max=?min,"",concat("..",?max)),concat("..",?max)),if(bound(?min),"..*","*"))) as ?kardinaliteit) where { ?shape sh:property ?propertyshape. OPTIONAL { ?propertyshape sh:minCount ?min } OPTIONAL { ?propertyshape sh:maxCount ?max } } } } # # simple mim:type # PREFIX rdfs: PREFIX owl: PREFIX sh: PREFIX mim: PREFIX dct: INSERT { GRAPH { ?element mim:type ?type } } WHERE { GRAPH { ?element rdfs:seeAlso ?propertyshape. ?type rdfs:seeAlso ?datatype. } GRAPH { select ?propertyshape ?datatype where { ?propertyshape sh:datatype ?datatype. } } } # # complex mim:type # PREFIX rdfs: PREFIX owl: PREFIX sh: PREFIX mim: PREFIX dct: INSERT { GRAPH { ?element mim:type ?type } } WHERE { GRAPH { ?element rdfs:seeAlso ?propertyshape. ?type rdfs:seeAlso ?datatype. } GRAPH { select ?propertyshape ?datatype where { ?propertyshape sh:node ?datatype. FILTER NOT EXISTS { ?datatype sh:targetClass ?class } } } } # # mim:lengte # PREFIX rdfs: PREFIX owl: PREFIX sh: PREFIX mim: PREFIX dct: INSERT { GRAPH { ?element mim:lengte ?lengte } } WHERE { GRAPH { ?element rdfs:seeAlso ?item. } GRAPH { ?item sh:maxLength ?lengte. } } # # mim:formeelPatroon # PREFIX rdfs: PREFIX owl: PREFIX sh: PREFIX mim: PREFIX dct: INSERT { GRAPH { ?element mim:formeelPatroon ?pattern } } WHERE { GRAPH { ?element rdfs:seeAlso ?item. } GRAPH { ?item sh:pattern ?pattern. } } # # mim:bron is al opgenomen bij het maken van mim:Relatiesoort # # # mim:doel # PREFIX rdfs: PREFIX owl: PREFIX sh: PREFIX mim: PREFIX dct: INSERT { GRAPH { ?element mim:doel ?doel } } WHERE { GRAPH { ?element rdfs:seeAlso ?propertyshape. ?doel rdfs:seeAlso ?shape. } GRAPH { ?propertyshape sh:class ?class. ?shape sh:targetClass ?class. } } # # mim specifieke aspecten # PREFIX rdfs: PREFIX owl: PREFIX sh: PREFIX mim: INSERT { GRAPH { ?element ?mimproperty ?mimvalue } } WHERE { GRAPH { ?element rdfs:seeAlso ?item } GRAPH { ?item ?mimproperty ?mimvalue FILTER (?mimproperty = mim:begripsterm || ?mimproperty = mim:toelichting || ?mimproperty = mim:herkomst || ?mimproperty = mim:herkomstDefinitie || ?mimproperty = mim:datumOpname || ?mimproperty = mim:authentiek || ?mimproperty = mim:indicatieAfleidbaar || ?mimproperty = mim:locatie || ?mimproperty = mim:patroon || ?mimproperty = mim:uniekeAanduiding || ?mimproperty = mim:populatie || ?mimproperty = mim:kwaliteit || ?mimproperty = mim:indicatieAbstractObject || ?mimproperty = mim:identificerend || ?mimproperty = mim:aggregatietype || ?mimproperty = mim:specificatieTekst || ?mimproperty = mim:specificatieFormeel || ?mimproperty = mim:constraint ) } }