PREFIX aocat: PREFIX skos: #AAT ENRICHMENT INSERT { GRAPH ::aatplus> { ?record aocat:has_derived_subject ?aat . } } USING ::aat> USING ::> WHERE { { ?record aocat:has_native_subject ?native_subject . ?native_subject skos:exactMatch ?aat . } union { ?record aocat:has_native_subject ?native_subject . ?native_subject skos:broadMatch ?aat . } union { ?record aocat:has_native_subject ?native_subject . ?native_subject skos:closeMatch ?aat . } union { ?record aocat:has_native_subject ?native_subject . ?native_subject skos:narrowMatch ?aat . } }; #if you need to uppercase (i.e. uppercase in aat data) PREFIX aocat: PREFIX skos: INSERT { GRAPH ::aatplus> { ?record aocat:has_derived_subject ?aat_subject . } } USING ::aat> USING ::> WHERE { { ?record aocat:has_native_subject ?native_subject . ?aat_native_subject skos:exactMatch ?aat_subject . bind (IRI(concat( "https://ariadne-infrastructure.eu/aocat/Concept//", ucase(strafter(str(?native_subject),"/")))) as ?uppercase_native_subject) filter(?uppercase_native_subject=?aat_native_subject) } union { ?record aocat:has_native_subject ?native_subject . ?aat_native_subject skos:broadMatch ?aat_subject . bind (IRI(concat( "https://ariadne-infrastructure.eu/aocat/Concept//", ucase(strafter(str(?native_subject),"/")))) as ?uppercase_native_subject) filter(?uppercase_native_subject=?aat_native_subject) } union { ?record aocat:has_native_subject ?native_subject . ?aat_native_subject skos:closeMatch ?aat_subject . bind (IRI(concat( "https://ariadne-infrastructure.eu/aocat/Concept//", ucase(strafter(str(?native_subject),"/")))) as ?uppercase_native_subject) filter(?uppercase_native_subject=?aat_native_subject) } union { ?record aocat:has_native_subject ?native_subject . ?aat_native_subject skos:narrowMatch ?aat_subject . bind (IRI(concat( "https://ariadne-infrastructure.eu/aocat/Concept//", ucase(strafter(str(?native_subject),"/")))) as ?uppercase_native_subject) filter(?uppercase_native_subject=?aat_native_subject) } }; #if you need to copy triples from the data graph to the aat/aatplus graph: PREFIX aocat: PREFIX skos: INSERT { GRAPH ::aatplus> { ?record aocat:has_derived_subject ?aat_subject . } } USING ::> WHERE { ?record aocat:has_derived_subject ?aat_subject . }; PREFIX aocat: PREFIX skos: INSERT { GRAPH ::aat> { ?aat_subject skos:prefLabel ?label . } } USING ::> WHERE { ?record aocat:has_derived_subject ?aat_subject . ?aat_subject skos:prefLabel ?label } #it could the case there is no prefLabel in the data graph: we have to find it somewhere (if there is not, then we might have a problem) # note that the ?label comes with the language tag PREFIX aocat: PREFIX skos: PREFIX skosxl: PREFIX gvp: INSERT { GRAPH ::aat> { ?aat_subject skos:prefLabel ?label . } } USING USING ::aatplus> WHERE { ?record aocat:has_derived_subject ?aat_subject . ?aat_subject rdf:type gvp:Concept . ?aat_subject gvp:prefLabelGVP ?lab . ?lab gvp:term ?label . }