Help

Difference between revisions of "SPARQL (HAL)"

Line 338: Line 338:
 
=== 🇶 Author name(s) → Author Qid(s) ===
 
=== 🇶 Author name(s) → Author Qid(s) ===
 
''This query is going to be DEPRECATED as the queried data will no longer be available.''
 
''This query is going to be DEPRECATED as the queried data will no longer be available.''
<!-- REVIEW REQUIRED -->
+
<!-- REVIEW REQUIRED -- >
 
{| style="width:100%"  
 
{| style="width:100%"  
 
|- style="vertical-align:top;"
 
|- style="vertical-align:top;"
Line 370: Line 370:
 
=== 🇶 Speaker Qid ([[Q445757]]) → Speaker data, all ===
 
=== 🇶 Speaker Qid ([[Q445757]]) → Speaker data, all ===
 
''This query is going to be DEPRECATED as the queried data will no longer be available.''
 
''This query is going to be DEPRECATED as the queried data will no longer be available.''
<!-- Q: alternative words for "predicate" and "object". "property" and "value" ?-->
+
<!-- Q: alternative words for "predicate" and "object". "property" and "value" ?-- >
 
{| style="width:100%"  
 
{| style="width:100%"  
 
|- style="vertical-align:top;"
 
|- style="vertical-align:top;"
Line 403: Line 403:
 
=== 🇶 Speaker Qid ([[Q445757]]) → Speaker languages ([[Property:P4|P4]]) ===
 
=== 🇶 Speaker Qid ([[Q445757]]) → Speaker languages ([[Property:P4|P4]]) ===
 
''This query is going to be DEPRECATED as the queried data will no longer be available.''
 
''This query is going to be DEPRECATED as the queried data will no longer be available.''
<!-- Q: Add languages iso P:13 -->
+
<!-- Q: Add languages iso P:13 -- >
 
{| style="width:100%"  
 
{| style="width:100%"  
 
|- style="vertical-align:top;"
 
|- style="vertical-align:top;"
Line 535: Line 535:
 
</query>
 
</query>
 
|}
 
|}
 +
 +
 +
-->

Revision as of 22:09, 14 June 2023

✅ HAL Authors

✅ Number of people in Wikidata with HAL Authors ID (P4450)

#defaultEndpoint:Wikidata
SELECT (COUNT(?item) AS ?number_Of_Hal_Authors_In_Wikidata)
WHERE {
  ?item wdt:P4450 ?halIdValue. 
}
... Loading ...


✅ HAL Authors on Wikidata → birthdate

#defaultEndpoint:Wikidata
SELECT ?item ?itemLabel ?halIdValue ?genderLabel (YEAR(?birthDate) AS ?birthYear)
WHERE {
  ?item wdt:P31 wd:Q5.                       # has HAL author ID `P4450`
  ?item wdt:P4450 ?halIdValue.               # HAL author ID `P4450` in ?halIdValue
  OPTIONAL { ?item wdt:P569 ?birthDate. }    # birthDate `P569` in ?birthDate
  # MINUS { ?item wdt:P569 ?birthDate. }
  OPTIONAL { ?item wdt:P21 ?gender. }        # gender `P21` in ?gender
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY DESC (?birthYear)
... Loading ...

✅ HAL Authors on Wikidata → Authors cv, publications

#defaultEndpoint:Wikidata
SELECT ?item
?itemLabel 
 (ENCODE_FOR_URI(?itemLabel) AS ?uriLabel)  # Wikipedia title
?halIdValue
 (CONCAT("https://cv.hal.science/", STR(?halIdValue)) AS ?halAuthorCv)  #
 (CONCAT("https://hal.science/search/index/q/*/authIdHal_s/", STR(?halIdValue)) AS ?halAuthorPublications)
 (CONCAT("https://api.archives-ouvertes.fr/search/?q=authIdHal_s:", STR(?halIdValue),'&wt=json') AS ?halAuthorPublicationsAPI)
WHERE {
  ?item wdt:P31 wd:Q5.                       # has HAL author ID `P4450`
  ?item wdt:P4450 ?halIdValue.               # HAL author ID `P4450` in ?halIdValue
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY DESC (?itemLabel)
... Loading ...

✅ HAL Authors on Wikidata → Authors per gender (P21)

1814 authors HAL author ID with in wikipedia

#defaultEndpoint:Wikidata
SELECT 
?genderLabel (count(?item) AS ?nb)           # counting gender
WHERE {
  ?item wdt:P31 wd:Q5;                       # has HAL author ID `P4450`
        wdt:P4450 ?halIdValue.               # HAL author ID `P4450` in ?halIdValue
  OPTIONAL { ?item wdt:P21 ?gender. }        # gender `P21` in ?gender
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
GROUP BY ?genderLabel
... Loading ...

✅ HAL Articles

SELECT ?item ?itemLabel ?value {

 ?item wdt:P7864 ?dbvalue.
 BIND(IF(wikibase:isSomeValue(?dbvalue), "", ?dbvalue) AS ?value)
 SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }

}

✅ Number of items in Wikidata with `HAL article ID` property (P7864 )

#defaultEndpoint:Wikidata
SELECT (COUNT(?item) AS ?number_Of_Hal_Article_ID_In_Wikidata)
WHERE {
  ?item wdt:P7864 ?halIdValue. 
}
... Loading ...

✅ Number of items in Wikidata with `HAL Article ID` property (P7864) but no creation date (P571)

#defaultEndpoint:Wikidata
SELECT (COUNT(?item) AS ?number_Of_Hal_Article_ID_In_Wikidata)
WHERE {
  ?item wdt:P7864 ?halIdValue. 
  MINUS { ?item wdt:P571 ?creationDate. }
}
... Loading ...

✅ HAL Article → creation date (inception)

#defaultEndpoint:Wikidata
SELECT ?item ?itemLabel ?halIdValue
(YEAR(?publicationDate) AS ?publicationYear) 
?publishedIn ?pages
(GROUP_CONCAT(?authorLabel1 ; separator=" | ") as ?authorsList)
WHERE {
  ?item wdt:P7864 ?halIdValue .
  OPTIONAL { ?item wdt:P1476 ?title }          # title `P1476`
  OPTIONAL { ?item wdt:P577 ?publicationDate } # publication date `P577`
  OPTIONAL { ?item wdt:P14233 ?publishedIn }   # published in `P14233`
  OPTIONAL { ?item wdt:P304 ?pages }           # pages `P304`
  OPTIONAL { ?item wdt:P2093 ?author }           # author `P50`
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  
  BIND(CONCAT(UCASE(SUBSTR(?author, 1 , 1 )), SUBSTR(?author, 2 )) AS ?authorLabel1)
}
GROUP BY ?item ?itemLabel ?halIdValue ?publicationDate ?publishedIn ?pages
... Loading ...

✅ HAL Journals

✅ Number of items in Wikidata with `HAL journal ID` property (P48903)

#defaultEndpoint:Wikidata
SELECT (COUNT(?item) AS ?number_Of_Hal_Jounal_ID_In_Wikidata)
WHERE {
  ?item wdt:P8903 ?halIdValue. 
}
... Loading ...

✅ Number of items in Wikidata with `HAL journal ID` property(P48903) but no creation date (P571)

#defaultEndpoint:Wikidata
SELECT (COUNT(?item) AS ?number_Of_Hal_Jounal_ID_In_Wikidata)
WHERE {
  ?item wdt:P8903 ?halIdValue. 
  MINUS { ?item wdt:P571 ?creationDate. }
}
... Loading ...

✅ HAL Journal → creation date (inception)

#defaultEndpoint:Wikidata
SELECT ?item ?itemLabel ?halIdValue (YEAR(?creationDate) AS ?creationYear)
WHERE {
  ?item wdt:P8903 ?halIdValue.
  OPTIONAL { ?item wdt:P571 ?creationDate. }
  # MINUS { ?item wdt:P571 ?creationDate. }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY DESC (?creationYear)
... Loading ...

🇶 HAL authors on Wikidata per gender (P21)

1814 authors HAL author ID with in wikipedia

#defaultEndpoint:Wikidata
SELECT 
?genderLabel (count(?item) AS ?nb)           # counting gender
WHERE {
  ?item wdt:P31 wd:Q5;                       # has HAL author ID `P4450`
        wdt:P4450 ?halIdValue.               # HAL author ID `P4450` in ?halIdValue
  OPTIONAL { ?item wdt:P21 ?gender. }        # gender `P21` in ?gender
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
GROUP BY ?genderLabel
... Loading ...

Work to come