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

function.event.query.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, Shacl. STTL. LDScript.

The newest version!
#
# Event Driven Function for SPARQL Query
# Write @event before query (after prefix)
#
prefix gui: 

@event 
select *
where {
    # process event for every query and load
    # bind (xt:tune(xt:visitor, true) as ?t)
    ?s foaf:name ?o
}

@init
function us:init(q) {
    xt:print("@init")
    ; gui:display("@init") # display in GUI System panel
    ; query(load rdf: ; insert data { us:John foaf:name "John" })
    ; xt:entailment()
}

@before 
function us:before(q) {
    xt:print("@before query")
    ; gui:display("@before query")
    ; xt:print("graph size:", xt:size(xt:graph()))
}

@after  
function us:after(res) {
    xt:print("@after query result size: ", xt:size(res))
    ; gui:display("@after query")
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy