All Downloads are FREE. Search and download functionalities are using the official Maven repository.

sttl.datashape.path.generic.rq Maven / Gradle / Ivy

Go to download

Corese is a Semantic Web Factory (triple store and SPARQL endpoint) implementing RDF, RDFS, SPARQL 1.1 Query and Update.

There is a newer version: 4.6.1
Show newest version
#
# [] a sh:NodeShape ; sh:property ?sh . 
# ?sh sh:path ?p ; ?q ?m .
# ?ls = list of subjects of path ?p
#
# ?value may be bound in the boolean cases:
# ?sh sh:path ?p ; sh:or ([sh:class C1][sh:class C2])
#
# template sh:or enumerate objects of path and 
# for each object ?value : check the or 
# the or evaluates its elements by coming back here with ?value bound
# this is done to use the same templates whether ?value is bound or not
#
prefix sh:  

template (?shape, ?sh, ?vis, ?ls, ?p, ?value) {
  sh:safe(?shape, ?sh, ?suc)
}
where {
    graph ?shape {  
        values ?q { 
            sh:minLength sh:maxLength sh:datatype sh:minInclusive sh:minExclusive sh:maxInclusive sh:maxExclusive 
            sh:nodeKind sh:class 
            sh:in sh:languageIn sh:node sh:property
        }
        ?sh ?q ?m    
    }

  values ?s { unnest(?ls) }

  values ?o { unnest(if (bound(?value), ?value, sh:path(?shape, ?s, ?p))) }

  bind (coalesce(sh:functioncall(?q, ?shape, ?o, ?m), false) as ?suc )
  
  bind (
    if (?q in (sh:property), true, st:report(?q, ?sh, ?shape, ?s, ?p, ?o, ?suc, ?vis))
    as ?b)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy