ShExStatements: Simplifying Shape Expressions for Wikidata

John Samuel

CPE Lyon

WikiWorkshop 2021, 14th April, 2021

Creative Commons License
ShExStatements
  • Motivation
    • describe and validate Wikidata entities
    • a light version of ShEx (shape expressions) based on WikiProjects
    • generate shape expressions from simple CSV statements and files.
    • Multilingual: support multiple languages
  • ShExStatements
    • simple tabular syntax with 5 columns
    • Demonstration: https://shexstatements.toolforge.org/
ShExStatements: TV Series
wd|<http://www.wikidata.org/entity/>|||
wdt|<http://www.wikidata.org/prop/direct/>|||
xsd|<http://www.w3.org/2001/XMLSchema#>|||

@tvseries|wdt:P31|wd:Q5398426|# instance of a tvseries
@tvseries|wdt:P136|@genre|*|# genre
@tvseries|wdt:P495|.|+|#country of origin
@tvseries|wdt:P57|.|+|#director
@tvseries|wdt:P58|.|+|#screenwriter
@genre|wdt:P31|wd:Q201658,wd:Q15961987|#instance of genre
          
PropertyDescription
wdt:P17Country
wdt:P131located in the administrative territorial entity
wdt:P625Coordinate location
wdt:P856Official website
wdt:P1705Native label
wdt:P6375Street address
Information related to Hospital on Wikidata (Wikidata:WikiProject Hospitals)
ShEx : How to describe and validate such information?
ShExStatements : How to describe and validate such information in a simple manner?
ShExStatements
Fig 1: ShExStatements
5 columns of ShExStatements
  • Node name: @hospital, @language,...
  • Property: foaf:name, wdt:P17,...
  • Allowed values: xsd:decimal, wd:Q16917,...
  • Cardinality: ?,+,*,1,2,...
  • Comments: #name
Separators in ShExStatements
  • ,: comma
  • |: vertical bar
  • ;: semi-colon
Prefixes and URLs in ShExStatements
  • Prefix: xsd, wdt,...
  • URL: <http://www.wikidata.org/prop/direct/>,...
ShExStatements: Hospital
wd,<http://www.wikidata.org/entity/>,,,
wdt,<http://www.wikidata.org/prop/direct/>,,,
xsd,<http://www.w3.org/2001/XMLSchema#>,,,

@hospital,wdt:P31,wd:Q16917,,# instance of a hospital
@hospital,wdt:P17,.,1,#country
@hospital,wdt:P131,.,1,#located in the administrative territorial entity
@hospital,wdt:P625,.,+,#coordinate location
@hospital,wdt:P856,.,*,#official website
          
Multilingual ShExStatements : How to describe and validate information in local languages?
ShExStatements: Hospital (Malayalam)
വിക്കിഡാറ്റ;<http://www.wikidata.org/entity/>;;;
പ്രോപ്പർട്ടി;<http://www.wikidata.org/prop/direct/>;;;
എക്സ്എസ്ഡി;<http://www.w3.org/2001/XMLSchema#>;;;

@ആശുപത്രി;പ്രോപ്പർട്ടി:P31;വിക്കിഡാറ്റ:Q16917,വിക്കിഡാറ്റ:Q7257872;# ആശുപത്രി
@ആശുപത്രി;പ്രോപ്പർട്ടി:P17;.;1; #രാജ്യം
@ആശുപത്രി;പ്രോപ്പർട്ടി:P131;.;1 ; #സ്ഥിതിചെയ്യുന്ന ഭരണസ്ഥലം
@ആശുപത്രി;പ്രോപ്പർട്ടി:P625;.;+;# ഭൗമനിർദ്ദേശാങ്കങ്ങൾ
@ആശുപത്രി;പ്രോപ്പർട്ടി:P856;IRI;*; # ഔദ്യോഗിക വെബ്സൈറ്റ്
          
Demonstration : https://shexstatements.toolforge.org/

Thank you

Questions?

John Samuel

https://johnsamuel.info/