Bibliographical Items: Difference between revisions

Line 78: Line 78:
} group by ?author ?authorLabel ?num_of_articles order by desc(?num_of_articles)
} group by ?author ?authorLabel ?num_of_articles order by desc(?num_of_articles)
</sparql>
</sparql>
== Authors with Wikidata ID ==
== Authors with Wikidata ID (federated query) ==
<sparql tryit="1">
<sparql tryit="1">
#title: Authors with Wikidata ID
#title: Authors with Wikidata ID (gets orcid, viaf, description from Wikidata)
 
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX schema: <http://schema.org/>
PREFIX wdtn: <http://www.wikidata.org/prop/direct-normalized/>
PREFIX enwb: <https://eneoli.wikibase.cloud/entity/>
PREFIX enwb: <https://eneoli.wikibase.cloud/entity/>
PREFIX endp: <https://eneoli.wikibase.cloud/prop/direct/>
PREFIX endp: <https://eneoli.wikibase.cloud/prop/direct/>


select ?author ?authorLabel (iri(concat("http://www.wikidata.org/entity/",?wd)) as ?wikidata)
select ?author ?authorLabel ?wikidata ?orcid ?viaf ?desc
        
        
where {  
where {  
   ?author endp:P5 enwb:Q5; endp:P1 ?wd.
   ?author endp:P5 enwb:Q5; endp:P1 ?wd.
  bind (iri(concat("http://www.wikidata.org/entity/",?wd)) as ?wikidata)
    
    
   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} group by ?author ?authorLabel ?wd order by lcase(?authorLabel)
  SERVICE <https://query.wikidata.org/sparql> {
          select ?wikidata ?orcid ?viaf ?desc
          where { ?wikidata schema:description ?desc. filter(lang(?desc)="en")
                  optional {?wikidata wdtn:P496 ?orcid.} optional {?wikidata wdtn:P214 ?viaf.}
          }
    }
order by lcase(?authorLabel)
</sparql>
</sparql>