Versions Compared

Key

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

This material pertains to outdated versions of VIVO. Rather than archiving the material, it should be updated to reflect current versions of VIVO.

Publications

List publications with common citation information

...

Code Block
titleList publications with common citation information
linenumberstrue
SELECT ?doi ?pub_label ?type_label ?venue_label ?issn ?issue ?startPage ?endPage ?volume ?year
WHERE{
    ?pub vivo:hasPublicationVenue ?venue .
    
    ?venue rdf:type bibo:Journal .
    ?venue bibo:issn ?issn .
    ?venue rdfs:label ?venue_label .

    ?pub rdfs:label $pub_label .
    ?pub vitro:mostSpecificType ?type .
    ?type rdfs:label ?type_label .
  
    ?pub vivo:dateTimeValue ?dtv . 
    ?dtv vivo:dateTime ?dt .
    BIND(SUBSTR(str(?dt),1,4) AS ?year)
    
    OPTIONAL { ?pub bibo:doi ?doi . }
    OPTIONAL { ?pub bibo:pageStart ?startPage . }
    OPTIONAL { ?pub bibo:pageEnd ?endPage . }    
    OPTIONAL { ?pub bibo:volume ?volume . }
    OPTIONAL { ?pub bibo:issue ?issue . }  
}

Authors

...

Count Publications by Year

The query creates a year variable for each publication and uses it to count publications by year.  It uses the same selection criteria as the query above.

Code Block
titleList Authors Count publications by Departmentyear
linenumberstrue
SELECT ?infoResource_label ?typeyear (COUNT(DISTINCT ?authorpub) ?firstNameAS ?lastName ?position_label ?department ?pemail
WHERE {
?infoResourcecount)
WHERE{
    ?pub vivo:hasPublicationVenue ?pubVenuevenue .
?pubVenue    
    ?venue rdf:type bibo:Journal .
    ?infoResourcevenue rdfbibo:typeissn ?anyTypeissn .
    ?anyTypevenue rdfs:label ?typevenue_label .

    ?infoResourcepub vivordfs:informationResourceInAuthorship ?authorshiplabel $pub_label .
  
    ?authorshippub rdfvivo:type vivo:AuthorshipdateTimeValue ?dtv . 
    ?authorshipdtv vivo:linkedAuthordateTime ?authorURIdt .
?authorURI rdfs:label ?author .
?infoResource rdfs:label ?infoResource_label .
OPTIONAL { $authorURI foaf:firstName ?firstName } .
OPTIONAL { $authorURI foaf:lastName ?lastName } .
OPTIONAL { $authorURI vivo:primaryEmail ?pemail } .
?authorURI vivo:personInPosition ?position .
?position vivo:positionInOrganization $organization .
?organization rdfs:label ?department .
?position rdfs:label ?position_label .
    BIND(SUBSTR(str(?dt),1,4) AS ?year) 
}
GROUP BY ?year
ORDER BY DESC(?year)

Authors

List authors by number of publications

The WHERE clause begins by finding people who have one or more authorships.  Each person in the result must have an rdfs:label.  The query then groups by author.  A COUNT aggregation is used to get the publication count.  The results are ordered by descending publication count – the authors with the highest number of publications will be listed first.  Some people have more than one rdfs:label – they may have name variations and/or they may have names with or without various language tags.  An aggregation on the author label returns a single author name.  In this query we use STR to remove any language tags, and then use MIN to get the first name variant in alphabetical order.  If the person has just one rdfs:label, that label is returned as the name.

Note:  When GROUP BY is used, aggregations must be used in the SELECT statement to indicate what will be done with multiple values of each attribute to appear in the result.

Note:  The use of the COUNT aggregation with a GROUP BY is a standard SPARQL pattern for generating a frequency table.  In this query we are creating a frequency table of publications by author.

Code Block
titleList authors by number of publications
linenumberstrue
SELECT (MIN(STR(?author_label)) AS ?author_name) (COUNT(DISTINCT ?authorship) AS ?pub_count)
WHERE {
    ?author vivo:relatedBy ?authorship .
    ?author a foaf:Person .
    ?authorship a vivo:Authorship .
    
    ?author rdfs:label ?author_label .
}
GROUP BY ?author
ORDER BY DESC(?pub_count)

People with less than five publications

...