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

webapp.data.query.display.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.

The newest version!
#
# Associate style to RDF graph to be displayed with D3.js
# style = image and hypertext link
#
select * where {
    ?s ?p ?o
    bind (us:process(?s) as ?a)
    bind (us:process(?o) as ?b)
}

function us:process(?s) {
    if (us:icon(?s), us:image(?s),
    if (isURI(?s), st:setlink(?s, us:link(?s)), true))
}

function us:image(?s) {
    st:setimg(?s, ?s) ;
    st:setlink(?s, ?s)
}

function us:link(?s) {
    st:format ( 
        "%s?param=%s" ,
        st:get(st:service),  encode_for_uri(?s) 
    )
}

function us:icon(?s) {
    strstarts(?s, "http://") && ! strstarts(?s, db:) &&
    mapany (rq:strends, ?s, xt:list(".jpg", ".svg", ".png", ".jpeg", ".JPG"))
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy