Skip to content

Commit

Permalink
Change qualified statements, update JSON Schema
Browse files Browse the repository at this point in the history
  • Loading branch information
nichtich committed Jan 15, 2025
1 parent 07d7c93 commit 4a9c5c8
Show file tree
Hide file tree
Showing 8 changed files with 189 additions and 155 deletions.
24 changes: 0 additions & 24 deletions examples/qualified-literal-map.json

This file was deleted.

21 changes: 21 additions & 0 deletions examples/qualified-literal.concept.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"uri": "http://www.wikidata.org/entity/Q406",
"qualifiedLiterals": {
"http://www.w3.org/2008/05/skos-xl#prefLabel": [
{
"type": [ "http://www.w3.org/2008/05/skos-xl#Label" ],
"literal": { "@value": "İstanbul", "@language": "tr" },
"rank": "preferred"
}, {
"type": [ "http://www.w3.org/2008/05/skos-xl#Label" ],
"literal": { "@value": "Constantinople", "@language": "en" },
"endDate": "1930"
}
],
"https://www.wikidata.org/wiki/Property:P395": [
{
"literal": { "@value": "34" }
}
]
}
}
19 changes: 8 additions & 11 deletions examples/qualified-relation-1.concept.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@
"uri": "http://www.wikidata.org/entity/Q42",
"prefLabel": { "en": "Douglas Adams" },
"qualifiedRelations": {
"http://www.wikidata.org/entity/P69": {
"prefLabel": { "en": "educated at" },
"values": [
{
"resource": { "uri": "http://www.wikidata.org/entity/Q4961791" },
"startDate": "1959",
"endDate": "1970",
"source": [ { "url": "https://www.brentwoodschool.co.uk/about/our-history/" } ]
}
]
}
"http://www.wikidata.org/entity/P69": [
{
"resource": { "uri": "http://www.wikidata.org/entity/Q4961791" },
"startDate": "1959",
"endDate": "1970",
"source": [ { "url": "https://www.brentwoodschool.co.uk/about/our-history/" } ]
}
]
}
}
38 changes: 17 additions & 21 deletions examples/qualified-relation-2.concept.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,23 @@
"uri": "http://www.wikidata.org/entity/Q3033",
"prefLabel": { "en": "Göttingen" },
"qualifiedRelations": {
"http://www.wikidata.org/entity/P17": {
"prefLabel": { "en": "country" },
"values": [
{
"resource": {
"uri": "http://www.wikidata.org/entity/Q183",
"prefLabel": { "en": "Germany" }
},
"startDate": "1990-10-03",
"rank": "preferred"
"http://www.wikidata.org/entity/P17": [
{
"resource": {
"uri": "http://www.wikidata.org/entity/Q183",
"prefLabel": { "en": "Germany" }
},
{
"resource": {
"uri": "http://www.wikidata.org/entity/Q713750",
"prefLabel": { "en": "West Germany" }
},
"startDate": "1949-05-23",
"endDate": "1990-10-02",
"rank": "normal"
}
]
}
"startDate": "1990-10-03",
"rank": "preferred"
},{
"resource": {
"uri": "http://www.wikidata.org/entity/Q713750",
"prefLabel": { "en": "West Germany" }
},
"startDate": "1949-05-23",
"endDate": "1990-10-02",
"rank": "normal"
}
]
}
}
33 changes: 33 additions & 0 deletions examples/qualified.concept.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"uri": "http://www.wikidata.org/entity/Q3033",
"prefLabel": { "en": "Göttingen" },
"qualifiedRelations": {
"http://www.wikidata.org/entity/P17": [
{
"resource": {
"uri": "http://www.wikidata.org/entity/Q183",
"prefLabel": { "en": "Germany" }
},
"startDate": "1990-10-03"
}
]
},
"qualifiedLiterals": {
"http://www.w3.org/2008/05/skos-xl#prefLabel": [
{
"type": [ "http://www.w3.org/2008/05/skos-xl#Label" ],
"literal": { "@value": "Göttingen", "@language": "de" },
"startDate": "1447",
"_comment": "Davor andere Schreibweisen ohne Umlaut"
}
]
},
"qualifiedDates": {
"https://www.wikidata.org/wiki/Property:P571": [
{
"date": "0953"
}
]
},
"_comment": "Nicht exakt Gründungsdatum aber erste Erwähnung"
}
36 changes: 9 additions & 27 deletions jskos.md
Original file line number Diff line number Diff line change
Expand Up @@ -927,28 +927,15 @@ Qualified statements are similar but not identical to properties in a property g

The term **qualified statement** refers to the combination of a *property type* and a *qualified value*. Qualified statements are grouped in *qualified maps* by the data type of their qualified values.

A **qualified map** is a JSON object that maps **property types** (each being an [URI]) to objects with the following fields:

field type definition
----------- --------------------------- -----------------------------------------------------------
prefLabel [language map] of strings labels of the property type, indexed by language (OPTIONAL)
values array of qualified values qualified values of same qualified data type (REQUIRED)
A **qualified map** is a JSON object that maps **property types** (each being an [URI]) to qualified values.

``` {.json #lst-qualified-map lst-cap="Qualified map with property types from schema.org"}
{
"https://schema.org/award": {
"prefLabel": { "en": "award" },
"values": [ ... ]
},
"https://schema.org/performerIn": {
"prefLabel": { "en": "performerIn" },
"values": [ ... ]
}
"https://schema.org/award": [ ... ],
"https://schema.org/performerIn": [ ... ]
}
```

Objects with empty array field `values` SHOULD be ignored.

A **qualified value** is a JSON object with the following optional fields:

field type definition
Expand All @@ -958,8 +945,7 @@ endDate [extended date] date when the statementn ended to be valid
source [set] sources as evidence for the statement
rank [rank] [rank] of the statement

If field `startDate` is given in a qualified value, the value of field
`endDate` MUST NOT be an interval with open start.
If field `startDate` is given in a qualified value, the value of field `endDate` MUST NOT be an interval with open start.

If field `endDate` is given in a qualified value, the value of `startDate` MUST
NOT be an interval with open end.
Expand Down Expand Up @@ -1010,26 +996,22 @@ Applications MAY disallow or ignore qualified dates without field `date`.
A **Qualified literal** is a [qualified value] with the following fields (in addition to the optional fields `rank`, `source`, `startDate`, and `endDate`):

field type definition
----------- --------------- --------------------------------------------------------------
literal string character string of the literal (RECOMMENDED)
language [language tag] language of the literal (RECOMMENDED, set to `und` by default)
----------- --------------- -----------------------------------------------------------------------
literal *see below* character string and optional language tag of the literal (RECOMMENDED)
uri [URI] Globally unique identifier of the literal (OPTIONAL)
type [list] of [URI] URIs of types (OPTIONAL)

<!-- TODO: make it a subclass of resource? -->
<!-- TODO: more about relation to plain fields -->

The first element of array field `type`, if given, MUST be <http://www.w3.org/2008/05/skos-xl#Label>.
The value of field `literal` MUST be a JSON objects with REQUIRED field `@value` for the character string and OPTIONAL field `@language` for the language, given as a [language tag]. Application MAY disallow or ignore qualified literals without field `literal`. Applications MAY use `und` as default value when no `@language` is specified.

Application MAY disallow or ignore qualified literals without field `literal`.
The first element of qualified literal array field `type`, if given, MUST be <http://www.w3.org/2008/05/skos-xl#Label>.

::: {.callout-note}
Qualified labels allow to express [SKOS eXtension for Labels (SKOS-XL)](https://www.w3.org/TR/skos-reference/#xl) in JSKOS.
:::

Qualified statements of data type qualified literal MUST NOT use the property types <http://www.w3.org/2004/02/skos/core#prefLabel>, <http://www.w3.org/2004/02/skos/core#altLabel>, and <https://www.w3.org/TR/skos-reference/#hiddenLabel> but they MAY use the corresponding URIs <http://www.w3.org/2008/05/skos-xl#prefLabel>, <http://www.w3.org/2008/05/skos-xl#altLabel>, and <http://www.w3.org/2008/05/skos-xl#hiddenLabel> instead.

```{.json #lst-qualified-literal lst-cap="Qualified map of qualified literals"}
```{.json #lst-qualified-literal lst-cap="Concept with qualified literals"}
{{< include examples/qualified-literal-map.json >}}
```

Expand Down
32 changes: 8 additions & 24 deletions schemas/item.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
]
}
},
"language-tag": {
"type": "string",
"pattern": "^([a-z]{1,8}(-[a-z0-9]{1,8})*-?|-)$"
},
"language-map": {
"type": "object",
"patternProperties": {
Expand Down Expand Up @@ -90,26 +94,6 @@
"type",
"items"
]
},
"edtf": {
"$comment": "EDTF Level 1",
"anyOf": [
{
"type": "string",
"pattern": "^Y?-?[0-9X]{4,}[?~%]?(-[012X][0-9X][?~%]?(-[0-3X][0-9X][?~%]?)?)?$",
"$comment": "EDTF Year, Year-Month, Year-Month-Day"
},
{
"type": "string",
"pattern": "^Y?-?[0-9X?~%-]{4,}T[0-9?~%:.]+(Z|[+-][0-9?~%:]+)?$",
"$comment": "EDTF Date and Time"
},
{
"type": "string",
"pattern": "^(|\\.\\.|[0-9TXYZ%~?.+-]+)/(|\\.\\.|[0-9TXYZ%~?.+-]+)$",
"$comment": "EDTF Interval (very lax)"
}
]
}
},
"allOf": [
Expand Down Expand Up @@ -168,21 +152,21 @@
},
"startDate": {
"description": "date of birth, creation, or estabishment of the item",
"$ref": "#/definitions/edtf"
"$ref": "resource.schema.json#/definitions/edtf"
},
"endDate": {
"description": "date death or resolution of the item",
"$ref": "#/definitions/edtf"
"$ref": "resource.schema.json#/definitions/edtf"
},
"relatedDate": {
"description": "other date somehow related to the item (deprecated, use relatedDates instead)",
"$ref": "#/definitions/edtf"
"$ref": "resource.schema.json#/definitions/edtf"
},
"relatedDates": {
"description": "other date somehow related to the item (deprecated, use relatedDates instead)",
"type": "array",
"items": {
"$ref": "#/definitions/edtf"
"$ref": "resource.schema.json#/definitions/edtf"
}
},
"location": {
Expand Down
Loading

0 comments on commit 4a9c5c8

Please sign in to comment.