SPARQL/REST service to get all the Vocabularies available in an EVN instance

54 views
Skip to first unread message

sanjeev devireddy

unread,
Apr 11, 2017, 9:03:34 AM4/11/17
to TopBraid Suite Users
Hello,
       We want to display an HTML page with Metadata(Name, Graph URI/URN, etc... ) of all available Vocabularies in an EVN application. It is basically to list all the vocabularies available in an EVN instance. Is there any SPARQL/REST service available to achieve this?


Thanks,
sanjeev

Irene Polikoff

unread,
Apr 11, 2017, 2:03:41 PM4/11/17
to topbrai...@googlegroups.com
Sanjeev

Most of the services and their definitions are listed on the Available Web Services page. 

Even if the service you need is not there, it is a good resource for figuring out how to create a service you need. “Teamwork” services would be particularly useful for the kind of thing you want to accomplish.

For example, taking an inspiration from teamwork:UsagesOfSoftwareSystem (spin:SelectTemplate) or teamwork:GraphsOfGivenTypeUnderTeamworkControl (spin:SelectTemplate), your service could be defined as follows:

SELECT ?projectGraph ?name
WHERE {
    rdf:nil teamwork:graphsUnderTeamControl ( ?projectGraph ?teamGraph ) .
    BIND (teamwork:projectLabel(?projectGraph) AS ?name) .
}
ORDER BY (?name)

It would not need any input arguments.

--
You received this message because you are subscribed to the Google Group "TopBraid Suite Users", the topics of which include the TopBraid Suite family of products and its base technologies such as SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to topbrai...@googlegroups.com
---
You received this message because you are subscribed to the Google Groups "TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to topbraid-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

sanjeev devireddy

unread,
Apr 12, 2017, 5:24:06 AM4/12/17
to TopBraid Suite Users
Thanks Irene, it works.

sanjeev devireddy

unread,
May 10, 2017, 2:38:23 AM5/10/17
to TopBraid Suite Users
Irene, the SPARQL that you gave works fine and returns all Taxonomies, Ontologies & Reference Data sets.
We have another requirement to write a SPARQL for fetching Taxonomies only but not others(Ontologies, Reference Datasets,.. ). For that, inspired from a SPARQL(given below), which is to fetch a specific Vocabulary's name and it's type (rdf:type) based on Graph URI, I tried adding one new line(?projectGraph rdf:type ?type .) to the SPARQL that you gave above for getting Vocabularies type also. But that returns zero results. Could you please help us here?

SPARQL to get specific Vocabulary's name and it's type(rdf:type)

SELECT ?vocabName ?type
            WHERE {
            GRAPH <urn:x-evn-master:geo>{
                    <urn:x-evn-master:geo>rdfs:label ?vocabName .
                    <urn:x-evn-master:geo>rdf:type ?type .
            } .
            FILTER  (ui:label(?type)="http://evn.topbraidlive.org/evnprojects#Taxonomy")
}


RESULT




SPARQL to get all vocabularies(Taxonomies, Ontologies, etc..) Grpah , name and type

SELECT ?projectGraph ?name ?type

WHERE {
    rdf:nil teamwork:graphsUnderTeamControl ( ?projectGraph ?teamGraph ) .
    BIND (teamwork:projectLabel(?projectGraph) AS ?name) .
    ?projectGraph rdf:type ?type .
    }
ORDER BY (?name)




Thanks,
sanjeev


On Tuesday, April 11, 2017 at 11:33:41 PM UTC+5:30, Irene Polikoff wrote:
Auto Generated Inline Image 1

Holger Knublauch

unread,
May 10, 2017, 2:48:40 AM5/10/17
to topbrai...@googlegroups.com
This works for me, but the ui:label may return different things depending on from where you run the query. Safer would be to compare URIs:

            FILTER  (?type = <http://evn.topbraidlive.org/evnprojects#Taxonomy>)

or (better):

SELECT ?vocabName

WHERE {
    GRAPH <urn:x-evn-master:geo>{
        <urn:x-evn-master:geo>rdfs:label ?vocabName .
        <urn:x-evn-master:geo>rdf:type <http://evn.topbraidlive.org/evnprojects#Taxonomy>
    }
}

To walk through all (when executing on a server where you are logged in with suitable privileges):

SELECT ?projectGraph
WHERE {
    () <http://topbraid.org/teamwork#readableGraphsUnderTeamControl> (?projectGraph ?teamGraph) .
    GRAPH ?projectGraph {
        ?projectGraph a <http://evn.topbraidlive.org/evnprojects#Taxonomy> .
    }
}

Holger

sanjeev devireddy

unread,
May 10, 2017, 8:53:23 AM5/10/17
to TopBraid Suite Users
Thanks Holger, it works.

Thanks,
Sanjeev
Reply all
Reply to author
Forward
0 new messages