1. CC-BY · page 1
Linked (Open) Data with SMW
#SMWCon, November 26, 2020
Bernhard Krabina
2. www.kdz.eu
Semantic MediaWiki
Collaborative data curation tool
Metadata tool (Content + Metadata)
Annotate data in texts
Knowledge Graph Interface
Web-based database
Open-Source, with vibrant community
Uses Semantic Web Standards
Internal querying of data
Importing and exporting of data
Business logic can be implemented by
customization, without PHP programming
7. www.kdz.eu
Open Data and SMW
Make your SMW readable by everyone
editing can still be restricted to logged-in users
Include an open license
see https://www.mediawiki.org/wiki/Manual:Copyright
Make it easy for users to access your data:
SMW puts a link to the RDF-representation (Special:ExportRDF) in the
HTML automatically, see https://www.semantic-
mediawiki.org/wiki/Help:RDF_export
create an RDF Dump https://www.semantic-
mediawiki.org/wiki/Help:Maintenance_script_dumpRDF.php
indicate exporting of data on pages or lists (e. g. vCard, iCalendar,
BibTex, KML)
provide export pages with explanations and several result formats
(CSV, JSON, RDF)
9. www.kdz.eu
Linking to external identifiers
Define a property
Assign datatype
„External identifier“
Links to external ids
Look for other identifiers
ORCID https://orcid.org/
GND
…..
[[Has type::External identifier]]
[[External formatter uri::http://www.wikidata.org/entity/$1]]
10. www.kdz.eu
Excursion: Service Links
Only works in Special:Browse
https://github.com/SemanticMediaWiki/SemanticMediaWiki/issues/4020
Property:WikidataID [[provides service::wikidata]]
MediaWiki:Smw_service_wikidata:
Wikidata|http://www.wikidata.org/entity/$1
11. www.kdz.eu
Using External Vocabularies
Add a page MediaWiki:Smw import foaf
Instead of local datatype declarations, use
[[Imported from::foaf:familyName]]
on the property page (e. g. Property:Last name)
To change a datatype, change it on MediaWiki:Smw
import foaf
https://www.semantic-mediawiki.org/wiki/Help:
Import_vocabulary
https://github.com/TIBHannover/ontology2smw/tree/issue31_ontologies_wout_aeon
Ad more vocabulary
terms any time…
12. www.kdz.eu
Using Page ID a unique ID
Define a property
Assign datatype „Text“
Set property in template
https://fina.oeaw.ac.at/wiki/?curid=10415
For „Magic Word“ {{PAGEID}} see
https://www.mediawiki.org/wiki/Help:
Magic_words#Technical_metadata
https://www.mediawiki.org/wiki/Manual:
Page_table#page_id
{{#set:FINA ID={{PAGEID}}}}
13. www.kdz.eu
Excursion: PageIDs
Set another property PageID
datatype „Page“
Use „Query forms“ for an ID
lookup
See Page Forms extension
https://www.mediawiki.org/wiki/Extension:
Page_Forms/Creating_query_forms
17. www.kdz.eu
Reconciliation / OpenRefine
SMW can provide „result formats“ RDF, JSON,
CSV, etc.
these an be accessed directly in OpenRefine
“Reconciliation”
means to look for
data matches with
WikiData
SMW can re-import
data via DataTransfer
extension
18. www.kdz.eu
The Future (of Knowledge Sharing)
reuse of „Service links“?
SMW could use the „Reconciliation API“ of
Wikidata
https://github.com/OpenRefine/OpenRefine/wiki/Reconciliation-Service-API
Flexibility of SMW property declaration could be
used to map to Wikidata properties
assign SMW Property:Country to P17
[[Imported from::ow:equivalentClass::P17]]
this changes RDF output, does not (yet) trigger feature inside SMW
pushing data to Wikidata (or other repos): should be doable inside
SMW: on a per-entry-base or batch