From bc08efde8e798b79b56824941abadd165da20a56 Mon Sep 17 00:00:00 2001 From: hkir-dev Date: Tue, 27 Jul 2021 16:34:22 +0100 Subject: [PATCH] #145 changed query to display the whole versionIRI (not only the date) --- src/sparql/inject-version-info.ru | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/sparql/inject-version-info.ru b/src/sparql/inject-version-info.ru index a2c8b0a..90beb88 100644 --- a/src/sparql/inject-version-info.ru +++ b/src/sparql/inject-version-info.ru @@ -11,13 +11,14 @@ INSERT { WHERE { ?ontology rdf:type owl:Ontology ; owl:versionIRI ?versionIRI . - # regex matches date and the previous text in the iri. When replaced string after the date remains - BIND (REPLACE(str(?versionIRI), "^.*\\d{4}[\\-]\\d{2}[\\-]\\d{2}", "") AS ?dateTrailingStr) - # regex matches date and the trailing text in the iri. When replaced string before the date remains - BIND (REPLACE(str(?versionIRI), "\\d{4}[\\-]\\d{2}[\\-]\\d{2}.*$", "") AS ?dateHeadingStr) - # replace heading and trailing text in the versionIRI to remain only the date - BIND (REPLACE(str(?versionIRI), ?dateTrailingStr, "") AS ?versionSubStr) - BIND (REPLACE(str(?versionSubStr), ?dateHeadingStr, "") AS ?versionStr) + BIND (str(?versionIRI) AS ?versionStr) +# # regex matches date and the previous text in the iri. When replaced string after the date remains +# BIND (REPLACE(str(?versionIRI), "^.*\\d{4}[\\-]\\d{2}[\\-]\\d{2}", "") AS ?dateTrailingStr) +# # regex matches date and the trailing text in the iri. When replaced string before the date remains +# BIND (REPLACE(str(?versionIRI), "\\d{4}[\\-]\\d{2}[\\-]\\d{2}.*$", "") AS ?dateHeadingStr) +# # replace heading and trailing text in the versionIRI to remain only the date +# # BIND (REPLACE(str(?versionIRI), ?dateTrailingStr, "") AS ?versionSubStr) +# # BIND (REPLACE(str(?versionSubStr), ?dateHeadingStr, "") AS ?versionStr) ?class rdf:type owl:Class . OPTIONAL { ?individual rdf:type owl:NamedIndividual . FILTER NOT EXISTS {?individual owl:versionInfo ?o1} }