Modelling: Difference between revisions

From MetaBase
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
{{Modelling navigation}}
Page under which Object modelling descriptions will be hosted:
Page under which Object modelling descriptions will be hosted:
==Basic ontology==
==Basic ontology==
Line 116: Line 118:
**'''SPARQL''': [https://metabase.wikibase.cloud/query/#PREFIX%20wd%3A%20%3Chttps%3A%2F%2Fmetabase.wikibase.cloud%2Fentity%2F%3E%0APREFIX%20wdt%3A%20%3Chttps%3A%2F%2Fmetabase.wikibase.cloud%2Fprop%2Fdirect%2F%3E%0A%23%20all%20available%20types%20of%20documents%0ASELECT%20%3Fitem%20%3FitemLabel%0AWHERE%0A%7B%0A%20%20%3Fitem%20wdt%3AP4%2a%20wd%3AQ21%20.%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22sv%2Cen%22.%20%7D%0A%7D All types of documents]
**'''SPARQL''': [https://metabase.wikibase.cloud/query/#PREFIX%20wd%3A%20%3Chttps%3A%2F%2Fmetabase.wikibase.cloud%2Fentity%2F%3E%0APREFIX%20wdt%3A%20%3Chttps%3A%2F%2Fmetabase.wikibase.cloud%2Fprop%2Fdirect%2F%3E%0A%23%20all%20available%20types%20of%20documents%0ASELECT%20%3Fitem%20%3FitemLabel%0AWHERE%0A%7B%0A%20%20%3Fitem%20wdt%3AP4%2a%20wd%3AQ21%20.%0A%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22sv%2Cen%22.%20%7D%0A%7D All types of documents]


* [[Modelling/Index terms|Index terms]]
** {{Q|Q18}}
**'''SPARQL''': [https://metabase.wikibase.cloud/query/#PREFIX%20wd%3A%20%3Chttps%3A%2F%2Fmetabase.wikibase.cloud%2Fentity%2F%3E%0APREFIX%20wdt%3A%20%3Chttps%3A%2F%2Fmetabase.wikibase.cloud%2Fprop%2Fdirect%2F%3E%0A%0ASELECT%20%3Fitem%20%3FitemLabelEN%20%3FitemLabelSV%0AWHERE%0A%7B%0A%20%20%20%20%3Fitem%20wdt%3AP5%20wd%3AQ12%20.%0A%20%20%20%20OPTIONAL%20%7B%3Fitem%20rdfs%3Alabel%20%3FitemLabelEN%20filter%20%28lang%28%3FitemLabelEN%29%20%3D%20%22en%22%29%7D.%0A%20%20%20%20OPTIONAL%20%7B%3Fitem%20rdfs%3Alabel%20%3FitemLabelSV%20filter%20%28lang%28%3FitemLabelSV%29%20%3D%20%22sv%22%29%7D.%0A%7D All index terms]




[[Category:Documentation]]
 
[[Category:Documentation|*]]

Revision as of 13:53, 9 May 2023


Page under which Object modelling descriptions will be hosted:

Basic ontology

On the top of the Metabase ontology is the following item:

Which has the immediate sub-item:

Query to find all items that are instance of (P5) or one or the other:

PREFIX wd: <https://metabase.wikibase.cloud/entity/>
PREFIX wdt: <https://metabase.wikibase.cloud/prop/direct/>

SELECT ?item ?wikidata_iri ?itemLabelEN ?itemLabelSV ?itemDescEN ?itemDescSV
WHERE
{
  {?item wdt:P5 wd:Q3.}
  UNION
  {?item wdt:P5 wd:Q10.}
  OPTIONAL {?item wdt:P1 ?wikidataQ}
  BIND(URI(concat("http://www.wikidata.org/entity/", ?wikidataQ)) AS ?wikidata_iri)
  OPTIONAL {?item rdfs:label ?itemLabelEN filter (lang(?itemLabelEN) = "en")}.
  OPTIONAL {?item rdfs:label ?itemLabelSV filter (lang(?itemLabelSV) = "sv")}.
  OPTIONAL {?item schema:description ?itemDescEN filter (lang(?itemDescEN) = "en")}.
  OPTIONAL {?item schema:description ?itemDescSV filter (lang(?itemDescSV) = "sv")}.
}

Try it!


Properties

Whenever possible, we aim to create properties whose scope duplicates that of properties in Wikidata. By using same as on Wikidata (P1), we then link to the equivalent Wikidata property. This lowers the threshold for Wikidata editors to start participating.

For example: organizer (P14), language of work or name (P20), number of participants (P28).

Metabase internal properties

We sometimes have a need for properties that do not have direct equivalents on Wikidata. For example when we need to describe the activities of the Wikimedia movement in more detail than what's relevant for Wikidata.

These properties shall have instance of (P5)Metabase internal property (Q24).

For example: WMSE project ID (P9), Wikimedia platform(s) affected (P13), sorted under programmatic area (P10).

Query to find all internal properties:

PREFIX wd: <https://metabase.wikibase.cloud/entity/>
PREFIX wdt: <https://metabase.wikibase.cloud/prop/direct/>

SELECT ?item ?itemLabelEN ?itemLabelSV ?itemDescEN ?itemDescSV
WHERE
{
  ?item wdt:P5 wd:Q24.
  OPTIONAL {?item rdfs:label ?itemLabelEN filter (lang(?itemLabelEN) = "en")}.
  OPTIONAL {?item rdfs:label ?itemLabelSV filter (lang(?itemLabelSV) = "sv")}.
  OPTIONAL {?item schema:description ?itemDescEN filter (lang(?itemDescEN) = "en")}.
  OPTIONAL {?item schema:description ?itemDescSV filter (lang(?itemDescSV) = "sv")}.
}

Try it!

Metabase vs. Wikidata

As we do not aim to duplicate the information on Wikidata, there's a number of item types that only contain a Wikidata QID, using same as on Wikidata (P1). These are:

By using federated queries, we can still access information about these types of entities from Wikidata, without hosting the data ourselves.

See some examples of federated queries.

Index terms

An index term (Q12) is a keyword that we use to describe e.g. the topic of a document or the focus area of a project.

For example: museum collection (Q18), public art (Q39), authority control (Q17).

Organizations

An organization (Q13) could be a Wikimedia chapter, a GLAM or any other organized social entity.

For example: Wikimedia Foundation (Q50), Wikimedia Sverige (Q9), Nationalmuseum (Q15).

Humans

We only create items about people when these are needed to describe authorship/speaker/event or project responsibility. And only when this information is already publicly available, any affiliation would also need to have been publicly communicated. Since the main affiliation might not always apply, it can be superseded by a qualifier on an item-by-item basis.

For example: Alicia Fagerving (Q46), André Costa (Q30).

Item types primarily offloaded on Wikidata

For the following item types we expect little or no information on Metabase. Required are only same as on Wikidata (P1) and instance of (P5) if they exist on Wikidata.

  • Organizations
    • If not on Wikidata, consider if it might anyway be relevant for Wikidata. Else add a Label and an additional instance of (P5) statement to an index term describing the type of organisation.
  • Locations: It is enough to stay at a town level of granularity, e.g. Stockholm (Q78) rather than Norrsken House. This is enough to get an insight about the geographical spread of activities.
  • Humans
    • If not on Wikidata, see humans for allowed modelling.

Metabase-specific items

Projects

A project could be:

  • a formal one officially implemented by an organization (a Wikimedia chapter, a GLAM, or other)
  • an informal one implemented by a self-organized group (such as participants in a Wikiproject), or an individual (a volunteer Wikimedian)

See the following:

Documents

Activities and events