Bibliographical Items: Difference between revisions

From eneoli wikibase
(Created page with "= Database Queries = == All bibliographical items == <sparql tryit="1"> #title: All bibliographical items PREFIX enwb: <https://eneoli.wikibase.cloud/entity/> PREFIX endp: <https://eneoli.wikibase.cloud/prop/direct/> select ?item ?typeLabel ?date ?itemLabel where { ?item endp:P5 enwb:Q2; endp:P6 ?type; endp:P30 ?date. SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } order by ?date </sparql>")
 
Line 14: Line 14:
   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} order by ?date
} order by ?date
</sparql>
== Publication years and number of articles ==
<sparql tryit="1">
#title: Publication years and # of articles
#defaultView:BarChart
PREFIX enwb: <https://eneoli.wikibase.cloud/entity/>
PREFIX endp: <https://eneoli.wikibase.cloud/prop/direct/>
select ?year (count(distinct ?item) as ?num_of_articles)
     
where {
  ?item endp:P5 enwb:Q2; endp:P30 ?date.
  bind(str(YEAR(?date)) as ?year)
  # SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} group by ?year ?num_of_articles order by ?year
</sparql>
</sparql>

Revision as of 13:37, 13 May 2024

Database Queries

All bibliographical items

#title: All bibliographical items

PREFIX enwb: <https://eneoli.wikibase.cloud/entity/>
PREFIX endp: <https://eneoli.wikibase.cloud/prop/direct/>

select ?item ?typeLabel ?date ?itemLabel 
       
where { 
  ?item endp:P5 enwb:Q2; endp:P6 ?type; endp:P30 ?date.
  
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} order by ?date

Try it!

Publication years and number of articles

#title: Publication years and # of articles
#defaultView:BarChart
PREFIX enwb: <https://eneoli.wikibase.cloud/entity/>
PREFIX endp: <https://eneoli.wikibase.cloud/prop/direct/>

select ?year (count(distinct ?item) as ?num_of_articles)
       
where { 
  ?item endp:P5 enwb:Q2; endp:P30 ?date.
  bind(str(YEAR(?date)) as ?year)
  # SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} group by ?year ?num_of_articles order by ?year

Try it!