This document discusses knowledge wikis and Semantic MediaWiki (SMW). SMW adds structured data and semantic web capabilities to MediaWiki wikis. It allows defining classes, properties, and relationships to build a knowledge graph. Properties can link to external vocabularies and identifiers. SMW supports querying the graph through its internal query language or by exporting data to a SPARQL endpoint. Use cases mentioned include history, knowledge management, and research wikis. The presenter is an expert in knowledge management and SMW who consults on its implementation and best practices.
2. Introduction
Managing partner at KM-A Knowledge
Management Associates
Active member of the Semantic
MediaWiki community ~ 15 years
Knowledge Graph researcher at WU
Vienna
Knowledge Management lecturer at
university of applied sciences
2
2
• KM consulting
• KM training
• KM research
• open-source SMW stack
• professional hosting
4. What is Semantic MediaWiki (SMW)?
• open source project:
– www.semantic-mediawiki.org
– https://github.com/SemanticMediaWiki
• the „swiss army knife“ for data and semantics
• built on the MediaWiki ecosystem:
the wiki engine that powers Wikipedia
can be used for much more than just wikis…
4
5. MediaWiki + SMW + more extensions
• collaborative editing
• version history of every edit
• no backend:
everything is a wiki page
• structure via categories and
namespaces
• API
• …
• structured data
(Web database)
• result lists and formats
via {{#ask:}} queries
• Semantic Web standards
• triplestore support
• API
• …
• online forms for data entry
• more visualizations
• responsive skin
• authentication
• image annotation
• SPARQL
• …
5
6. 1
2
3
Agenda
What is Semantic MediaWiki?
Semantic MediaWiki,
Ontologies and Knowledge Graphs
How re-use EU vocabularies?
7. Semantic MediaWiki as Knowledge
Graph tool
KG Definition (Sack/Alam 2020) Semantic MediaWiki
concepts Concept:
classes Category: rdf:type
properties Property: with datatypes
relationships annotations via wikitext or templates
entity descriptions wiki pages
RDF(S)/OWL / (OWL 2 DL)
open/private/closed //
original/derived/agregated //
instance data wiki pages or subobjects (instances without wiki pages)
schema data Help:Schema
metadata via special semantic properties
Taxonomies subcategories rdfs:subClassOf
links and mappings to external data datatype „External identifier“, vocabulary import
FAIR data principles 7
8. Semantic MediaWiki storage options
SQL Store (default)
• extra tables in the
SQL store of
MediaWiki
ElasticStore
• search engine, not a
storage backend
SPARQL/RDF Store
• custom, default
• Virtuoso
• Blazegraph
• Fuseki
• Sesame
• 4store 8
easy (to install) harder to install but more powerful
12. Building your Knowledge Graph
• page Vienna can have properties
– number of inhabitants, located in,
coordinates, WikidataID, …
• properties can have various data types
– page, text, number, date, URL, …
– external identifier links to external resources
• re-use external vocabularies
– “Lastname” imported from schema:familyName
• a page should be put into a category
12
optional
setup templates
setup forms
do internal querying
use built in search
interfaces
13. Unique IDs in MediaWiki
Every page has a unique page ID
You can display it and use it to link
to a page without using the page
name (that could change over time)
– https://www.caf-network.eu/
Special:URIResolver/?curid=185
supports content negotiation
14. 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]]
15. Using External Vocabularies
1. Add a page MediaWiki:Smw import foaf
2. Instead of local datatype declarations, use
[[Imported from::foaf:familyName]]
on the property page (e. g. Property:Last name)
Ad more vocabulary terms any
time…
16. Changing data types in SMW
https://www.caf-network.eu/MediaWiki:Smw_import_dcterms
17. Maintaining your Knowledge Graph
Data/ontology curation: “semantic gardening”
• user rights
– admins, curators, users
• property annotation health
– Outdated properties/entities
– Similar properties
– Property uniqueness
– Improper annotations and failed queries
– Missing redirect annotations
https://www.semantic-mediawiki.org/wiki/Semantic_gardening
17
Inferencing
• subcategories
• subproperties
• equality of pages:
redirects
• subqueries
https://www.semantic-
mediawiki.org/wiki/Help:Inferencing
18. Semantic MediaWiki or Wikibase?
https://www.mediawiki.org/wiki/Manual:Managing_data_in_MediaWiki
Semantic MediaWiki Wikibase
flexible data model data model of Wikidata
properties can be pre-defined or declared by annotating properties need to be pre-defined
properties (and datatypes) can be changed any time properties cannot be changed!
requires extensions for form-based input comes with a fixed, built-in edit interface
SPARQL only with external triplestore
internal query language (easier than SPARQL) no built-in querying of data
enterprise-ready (stability, commercial support) getting there…
18