Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

11.   Let’s write a query that finds organizations whose members do research on endocrinology.  Instead of searching on a text string, we’ll use the URI of a SKOS Concept for endocrinology, http://vivo.ufl.edu/individual/n84048.  Our query will find people who are specified as having this concept as a research area, and additionally ask for the organizations in which they hold positions.

Enter the following query into the text box:

Code Block
titleSPARQL for organizationsto copy and paste
PREFIX vivo: <http://vivoweb.org/ontology/core#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT DISTINCT ?orgName
WHERE {
    ?person vivo:hasResearchArea <http://vivo.ufl.edu/individual/n84048> .
    ?person vivo:personInPosition ?position .
    ?position vivo:positionInOrganization ?organization .
    ?organization rdfs:label ?orgName .
}

 

Enter the following query into the text box:

 

PREFIX vivo: <http://vivoweb.org/ontology/core#>

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

 

SELECT DISTINCT ?orgName

WHERE {

    ?person vivo:hasResearchArea <http://vivo.ufl.edu/individual/n84048> .

    ?person vivo:personInPosition ?position .

    ?position vivo:positionInOrganization ?organization .

    ?organization rdfs:label ?orgName .

}

 

 

 

This is what it should look like in Fuseki:

Image Added

12.  Select “Text” in the Output dropdown list and then press the “Get Results” button.  After a few seconds you should see some results. 

Image Added

 

 

13.  Now let’s augment the query with additional relationships.  We’ll follow a longer chain of relationships from people who have endocrinology as a research area in order to discover the research areas of their coauthors.

 

Press the back arrow and paste this query into the text box: 

Code Block
titleSPARQL to cut and paste
PREFIX vivo:

...

 <http://vivoweb.org/ontology/

...

core#>
PREFIX rdfs:

...

 <http://www.w3.org/2000/01/rdf-

...

 

...

schema#>

SELECT DISTINCT ?researchAreaName

...


WHERE

...

 {
    ?person vivo:hasResearchArea

...

 <http://vivo.ufl.edu/individual/

...

n84048> .
    ?person vivo:authorInAuthorship ?authorship

...

 .
    ?authorship vivo:linkedInformationResource ?doc

...

 .
    ?doc vivo:informationResourceInAuthorship ?authorship2

...

 .
    ?authorship2 vivo:linkedAuthor ?coauthor

...

 .
    ?coauthor vivo:hasResearchArea ?researchArea

...

 .
    ?researchArea rdfs:label ?researchAreaName

...

 .
    FILTER(?authorship != ?authorship2)

...


}

...

This query will return some different concept names:

 Image Added

 

 

14.  By replacing the concept URI http://vivo.ufl.edu/individual/n84048 with different concept URIs, we can find different sets of organizations and coauthor research areas.  How can we find different URIs to try? 

Try this query.  It may take a few seconds to return the list. 

Code Block
titleSPARQL to cut and paste
PREFIX vivo:

...

 <http://vivoweb.org/ontology/

...

core#>
PREFIX rdfs:

...

 <http://www.w3.org/2000/01/rdf-

...

schema#>
PREFIX skos:

...

 <http://www.w3.org/2004/02/skos/

...

 

...

core#>

SELECT DISTINCT ?concept ?conceptName

...


WHERE

...

 {
    ?concept a skos:Concept

...

 .
    ?concept rdfs:label ?conceptName
}

<end of exercise>}