Skip to content

Commit

Permalink
Add examples
Browse files Browse the repository at this point in the history
  • Loading branch information
nichtich committed Jan 9, 2025
1 parent 5c2e2f6 commit f323243
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 30 deletions.
17 changes: 17 additions & 0 deletions examples/qualified-relation-1.concept.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"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/" } ]
}
]
}
}
}
28 changes: 28 additions & 0 deletions examples/qualified-relation-2.concept.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"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"
},
{
"resource": {
"uri": "http://www.wikidata.org/entity/Q713750",
"prefLabel": { "en": "West Germany" }
},
"startDate": "1949-05-23",
"endDate": "1990-10-02",
"rank": "normal"
}
]
}
}
}
4 changes: 4 additions & 0 deletions jskos.md
Original file line number Diff line number Diff line change
Expand Up @@ -912,6 +912,10 @@ used with caution because they increase complexity and limit interoperability.

:::

```{.json #lst-qualified-relation lst-cap="Concept with qualified relations (from Wikidata)"}
{{< include examples/qualified-relation-2.concept.json >}}
```

# Item and concept types

[item type]: #item-and-concept-types
Expand Down
71 changes: 41 additions & 30 deletions schemas/resource.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,43 +143,54 @@
},
"qualifiedRelations": {
"type": "object",
"properties": {
"prefLabel": {
"description": "labels of the property type, indexed by language",
"$ref": "item.schema.json#/definitions/language-map"
}
"propertyNames": {
"$ref": "#/definitions/uri"
},
"values": {
"type": "array",
"items": {
"patternProperties": {
".*": {
"type": "object",
"properties": {
"resource": {
"description": "object of the relation",
"$ref": "#"
},
"startDate": {
"description": "date when the relation started to be valid",
"$ref": "item.schema.json#/definitions/edtf"
},
"endDate": {
"description": "date when the relation ended to be valid",
"$ref": "item.schema.json#/definitions/edtf"
},
"source": {
"description": "sources as evidence for the relation",
"$ref": "concept.schema.json#/definitions/conceptSet"
"prefLabel": {
"description": "labels of the property type, indexed by language",
"$ref": "item.schema.json#/definitions/language-map"
},
"rank": {
"$ref": "#/definitions/rank"
"values": {
"description": "qualified values",
"type": "array",
"items": {
"type": "object",
"properties": {
"resource": {
"description": "object of the relation",
"$ref": "#"
},
"startDate": {
"description": "date when the relation started to be valid",
"$ref": "item.schema.json#/definitions/edtf"
},
"endDate": {
"description": "date when the relation ended to be valid",
"$ref": "item.schema.json#/definitions/edtf"
},
"source": {
"description": "sources as evidence for the relation",
"$ref": "concept.schema.json#/definitions/conceptSet"
},
"rank": {
"$ref": "#/definitions/rank"
}
},
"additionalProperties": false
},
"additionalProperties": false
}
},
"additionalProperties": "false"
"required": ["values"],
"additionalProperties": false
}
}
},
"required": ["values"],
"additionalProperties": "false"
},
"additionalProperties": false
}
},
"patternProperties": {
"^_|^[A-Z0-9]+$": {}
Expand Down

0 comments on commit f323243

Please sign in to comment.