ShExStatements

Simplifying Shape Expressions

John Samuel

16th December 2020

Meeting on DublinCore Tabular Application Profiles

ShExStatements
  • based on a light version of ShEx
  • generate shape expressions from simple CSV statements and files.
  • simple syntax, with 5 columns
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
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
          

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
          
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/

References

  1. ShEx https://www.w3.org/community/shex/
  2. ShExStatements online https://shexstatements.toolforge.org/
  3. ShExStatements https://github.com/johnsamuelwrites/ShExStatements
  4. ShExStatements Python package https://pypi.org/project/shexstatements/

Thank you

John Samuel

https://johnsamuel.info/

Questions?