Project:Migration

From MatVoc
Jump to navigation Jump to search

In 2026, MatVoc Wikibase migrated from being self-hosted under NIMS domain to the current setup at Wikibase Cloud. This page outlines the changes.

URL changes

Website Old URL New URL Redirect status
MatVoc Wikibase https://matvoc.nims.go.jp/ https://matvoc.wikibase.cloud/ Automatically redirects
MatVoc Explorer https://matvoc.nims.go.jp/explore/ https://matvoc.nims.go.jp/explore/ N/A (URL unchanged)
Interactive Query Service https://matvoc.nims.go.jp/query/ https://matvoc.wikibase.cloud/query/ Automatically redirects
SPARQL Endpoint https://matvoc.nims.go.jp/graph/sparql https://matvoc.wikibase.cloud/query/sparql Does not redirect (as of now)

SPARQL query changes

Existing SPARQL queries will not work as-is. Please update them as described below.

MatVoc entities now need their own prefixes

In the old setup, MatVoc items and properties were written with the wd: and wdt: prefixes.

In the new setup, the query service predefines wd:, wdt:, p:, ps:, and pq: as Wikidata namespaces. For example, wd:Q1 expands to http://www.wikidata.org/entity/Q1. As a result, an old query that uses these prefixes will run without errors but return no MatVoc results. MatVoc data uses URIs under https://matvoc.wikibase.cloud/, so you need to declare MatVoc prefixes at the top of your query and use them throughout the query body.

PREFIX mv:    <https://matvoc.wikibase.cloud/entity/>
PREFIX mvt:   <https://matvoc.wikibase.cloud/prop/direct/>
PREFIX mvp:   <https://matvoc.wikibase.cloud/prop/>
PREFIX mvps:  <https://matvoc.wikibase.cloud/prop/statement/>
PREFIX mvpq:  <https://matvoc.wikibase.cloud/prop/qualifier/>
Old prefix New prefix Used for
wd: mv: Items and properties (Q…, P…)
wdt: mvt: Direct ("truthy") property values
p: mvp: Statement nodes
ps: mvps: Statement values
pq: mvpq: Qualifiers

Note: These URIs use https://. A prefix declared with http:// will not match any MatVoc data. If in doubt, check the entity's Concept URI in the sidebar of any item page.

Example

Before (old endpoint; this will not work on the new Query Service):

SELECT ?item ?itemLabel ?broader ?broaderLabel WHERE {
  ?item wdt:P8 ?broader .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en,ja". }
}
LIMIT 10

After (new endpoint):

PREFIX mv:  <https://matvoc.wikibase.cloud/entity/>
PREFIX mvt: <https://matvoc.wikibase.cloud/prop/direct/>

SELECT ?item ?itemLabel ?broader ?broaderLabel WHERE {
  ?item mvt:P8 ?broader .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en,ja". }
}
LIMIT 10

Try it!


Standard prefixes such as rdfs:, wikibase:, and bd:, along with the label service, work the same way as before.

Quick migration tip

If you have many existing queries, the fastest fix is usually to:

  1. Change the endpoint URL.
  2. Add the PREFIX declarations above to the top of each query.
  3. Replace wd: → mv:, wdt: → mvt:, p: → mvp:, ps: → mvps:, and pq: → mvpq: in the query body.

Use whole-word matching (e.g. the regex \bp:) when replacing. A plain text replace of p: would also match the end of http: inside <http://…> URIs and turn them into httmvp://.