Skip to content

Commit

Permalink
#145 changed query to display the whole versionIRI (not only the date)
Browse files Browse the repository at this point in the history
  • Loading branch information
hkir-dev committed Jul 27, 2021
1 parent ca8eaf8 commit bc08efd
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/sparql/inject-version-info.ru
Original file line number Diff line number Diff line change
Expand Up @@ -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} }
Expand Down

0 comments on commit bc08efd

Please sign in to comment.