Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 49 additions & 11 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,28 +77,28 @@ Get Product by Id : `https://acme.com/skg-if/api/products/prod-1`
``` json
{
"meta" : {
"local_identifier": "https://w3id.org/skg-if/sandbox/acme/prod-1", // parent local_identifier / PID
"local_identifier": "https://acme.com/skg-if/api/products/prod-1", // parent entity : API URL
"entity_type": "single_entity",
"api_items": [
{
"local_identifier": "https://w3id.org/skg-if/sandbox/acme/pers-1", // local_identifier / PID
"local_identifier": "https://w3id.org/skg-if/sandbox/acme/pers-1", // child entity : local_identifier / PID
"urls": [
{
"entity_type": "link",
"rel": "self",
"href": "https://acme.com/skg-if/api/persons/pers-1" // API link
"href": "https://acme.com/skg-if/api/persons/pers-1" // child entity : API link
}
]
}
]
},
"@graph": [
{
"local_identifier": "https://w3id.org/skg-if/sandbox/acme/prod-1",
"local_identifier": "https://w3id.org/skg-if/sandbox/acme/prod-1", // parent entity : local_identifier / PID
"contributions": [
{
"by" : {
"local_identifier": "https://w3id.org/skg-if/sandbox/acme/pers-1"
"local_identifier": "https://w3id.org/skg-if/sandbox/acme/pers-1" // child entity : local_identifier / PID
//...
}
//...
Expand All @@ -119,25 +119,45 @@ Get List of Product : `https://acme.com/skg-if/api/products?filter=xxx&page=1`
"entity_type": "single_entity",
"api_items": [
{
"local_identifier": "https://w3id.org/skg-if/sandbox/acme/pers-1", // local_identifier / PID
"local_identifier": "https://w3id.org/skg-if/sandbox/acme/prod-1", // search result 1 - parent entity : local_identifier / PID
"urls": [
{
"entity_type": "link",
"rel": "self",
"href": "https://acme.com/skg-if/api/persons/pers-1" // API link
"href": "https://acme.com/skg-if/api/products/prod-1" // search result 1 - parent entity : API link
}
]
}
},
{
"local_identifier": "https://w3id.org/skg-if/sandbox/acme/pers-1", // search result 1 - child entity : local_identifier / PID
"urls": [
{
"entity_type": "link",
"rel": "self",
"href": "https://acme.com/skg-if/api/persons/pers-1" // search result 1 - child entity : API link
}
]
},
{
"local_identifier": "https://w3id.org/skg-if/sandbox/acme/prod-2", // search result 2 - parent entity : local_identifier / PID
"urls": [
{
"entity_type": "link",
"rel": "self",
"href": "https://acme.com/skg-if/api/products/prod-2" // search result 2 - parent entity : API link
}
]
},
]

},
"@graph": [
{
"local_identifier": "https://w3id.org/skg-if/sandbox/acme/prod-1",
"local_identifier": "https://w3id.org/skg-if/sandbox/acme/prod-1", // search result 1 - parent entity : local_identifier / PID
"contributions": [
{
"by" : {
"local_identifier": "https://w3id.org/skg-if/sandbox/acme/pers-1"
"local_identifier": "https://w3id.org/skg-if/sandbox/acme/pers-1" // search result 1 - child entity : local_identifier / PID
//...
}
//...
Expand All @@ -146,7 +166,7 @@ Get List of Product : `https://acme.com/skg-if/api/products?filter=xxx&page=1`
//...
},
{
"local_identifier": "https://w3id.org/skg-if/sandbox/acme/prod-1"
"local_identifier": "https://w3id.org/skg-if/sandbox/acme/prod-2" // search result 2 - parent entity : local_identifier / PID
//...
},

Expand All @@ -156,5 +176,23 @@ Get List of Product : `https://acme.com/skg-if/api/products?filter=xxx&page=1`
```


## API Get Entity by Id, single entity resolving

Single entity resolve API format follows this format `https://acme.com/skg-if/api/{entity-type}/{local_identifier}`

For example : `https://acme.com/skg-if/api/products/prod-1`

Your API _MUST_ also be able to resolve full local_identifiers including the domain/base :

`https://acme.com/skg-if/api/products/https://w3id.org/skg-if/sandbox/acme/prod-1`


Note : this pattern is also used in standard SKG API like Crossref

* http://api.crossref.org/works/https://doi.org/10.1039/d1cb00160d => OK
* http://api.crossref.org/works/10.1039/d1cb00160d => OK





Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,9 @@
}
],
"meta": {
"local_identifier": "https://w3id.org/skg-if/sandbox/acme/prod-1",
"local_identifier": "https://acme.com/skg-if/api/products/prod-1",
"entity_type": "single_entity",
"api_items": [
{
"local_identifier": "https://w3id.org/skg-if/sandbox/acme/prod-1",
"urls": [
{
"entity_type": "link",
"rel": "self",
"href": "https://acme.com/skg-if/api/products/prod-1"
}
]
},
{
"local_identifier": "https://w3id.org/skg-if/sandbox/acme/pers-1",
"urls": [
Expand Down
56 changes: 12 additions & 44 deletions openapi/ver/current/skg-if-openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,9 @@ paths:
{"@base" : "https://w3id.org/skg-if/sandbox/acme/"}
]
"meta" :
local_identifier: product-1-fgp
local_identifier: https://example.com/skg-if/api/products/product-1-fgp
entity_type: single_entity
api_items:
- local_identifier: product-1-fgp
urls:
- entity_type: "link"
rel: "self"
href: "https://example.com/skg-if/api/products/product-1-fgp"
- local_identifier: person-5-mw
urls:
- entity_type: "link"
Expand Down Expand Up @@ -217,14 +212,8 @@ paths:
{"@base" : "https://w3id.org/skg-if/sandbox/acme/"}
]
"meta" :
local_identifier: product-2-ogd
local_identifier: https://example.com/skg-if/api/products/product-2-ogd
entity_type: single_entity
api_items:
- local_identifier: product-2-ogd
urls:
- entity_type: "link"
rel: "self"
href: "https://example.com/skg-if/api/products/product-2-ogd"
"@graph" :
- local_identifier: product-2-ogd
entity_type: product
Expand Down Expand Up @@ -883,14 +872,9 @@ paths:
{"@base" : "https://w3id.org/skg-if/sandbox/acme/"}
]
"meta" :
local_identifier: grant-1-go
local_identifier: https://example.com/skg-if/api/grants/grant-1-go
entity_type: "single_entity"
api_items:
- local_identifier: grant-1-go
urls:
- entity_type: "link"
rel: "self"
href: "https://example.com/skg-if/api/grants/grant-1-go"
- local_identifier: person-1-jc
urls:
- entity_type: "link"
Expand Down Expand Up @@ -1135,14 +1119,8 @@ paths:
{"@base" : "https://w3id.org/skg-if/sandbox/acme/"}
]
"meta" :
local_identifier: venue-1-jp
local_identifier: https://example.com/skg-if/api/venues/venue-1-jp
entity_type: "single_entity"
api_items:
- local_identifier: venue-1-jp
urls:
- entity_type: "link"
rel: "self"
href: "https://example.com/skg-if/api/venues/venue-1-jp"
"@graph" :
- local_identifier: venue-1-jp
entity_type: "venue"
Expand Down Expand Up @@ -1275,14 +1253,8 @@ paths:
{"@base" : "https://w3id.org/skg-if/sandbox/acme/"}
]
"meta" :
local_identifier: topic-1-cs
local_identifier: https://example.com/skg-if/api/topics/topc-1-cs
entity_type: "single_entity"
api_items:
- local_identifier: topic-1-cs
urls:
- entity_type: "link"
rel: "self"
href: "https://example.com/skg-if/api/topics/topc-1-cs"
"@graph" :
- local_identifier: topic-1-cs
entity_type: "topic"
Expand Down Expand Up @@ -1426,14 +1398,8 @@ paths:
{"@base" : "https://w3id.org/skg-if/sandbox/acme/"}
]
"meta" :
local_identifier: datasource-1-oura
local_identifier: https://example.com/skg-if/api/venues/datasource-1-oura
entity_type: "single_entity"
api_items:
- local_identifier: datasource-1-oura
urls:
- entity_type: "link"
rel: "self"
href: "https://example.com/skg-if/api/venues/datasource-1-oura"
"@graph" :
- local_identifier: datasource-1-oura
entity_type: "datasource"
Expand Down Expand Up @@ -2836,10 +2802,12 @@ components:
properties:
local_identifier:
type: string
description: entity id as URL
description: Entity API URL. local_identifier can be expressed with ot without full domain. Full domain, including your @base, MUST also resolve
examples:
- http://w3id.org/skg-if/sandbox/acme/product-1
- http://w3id.org/skg-if/sandbox/acme/person-1
- https://example.com/skg-if/api/products/product-1
- https://example.com/skg-if/api/persons/person-1
- https://acme.com/skg-if/api/products/https://w3id.org/skg-if/sandbox/acme/prod-1
- https://acme.com/skg-if/api/persons/https://w3id.org/skg-if/sandbox/acme/person-1
entity_type:
type: string
description: single entity
Expand Down Expand Up @@ -2969,7 +2937,7 @@ components:
type: string
description : |
Default root URL of the JSON-LD context. \
To define your `@base`, please refer to the [SKG-IF OpenAPI Implementer documentation](https://docs.google.com/document/d/1t7b7h28UTtM56Sda4NGJIp0hnQfGbcVVGn12fny9wfI/edit?usp=sharing) \
To define your `@base`, please refer to the [SKG-IF API doc](https://skg-if.github.io/api/) \
Your `@base` should end with a `/` \
common formats : \
- `https://acme.com/skg/` \
Expand Down
Loading