Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#ILEX-78 - Update mock variant endpoint , revised after reviewing UI for 78 #69

Draft
wants to merge 2 commits into
base: devel
Choose a base branch
from
Draft
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
144 changes: 5 additions & 139 deletions interlex.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -623,81 +623,9 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Error'
/{group}/variants/{term}:
get:
summary: List all variants for a term
operationId: get_variants
tags:
- term
parameters:
- name: group
in: path
required: true
description: The group of the term to retrieve
schema:
type: string
- name: term
in: path
required: true
description: The id of the term to retrieve
schema:
type: string
responses:
200:
description: A paged array of variants
headers:
x-next:
description: A link to the next page of responses
schema:
type: string
content:
application/json:
schema:
$ref: '#/components/schemas/Variants'
example:
[
{
"id" : "variant_ilx_0101901",
"organization" : "Interlex Lab",
"description" : "The central nervous system is the part of the nervous system...",
"timestamp" : "24 March 12:08am",
"status" : "Active",
"originatingUser" : {
"userID" : "olivia",
"userName" : "Oliviya Rhye"
},
"editingUser" : {
"userID" : "olivia",
"userName" : "Oliviya Rhye"
},
"url" : "https://uri.olympiangods.org/base/ilx_0101901.jsonld",
},
{
"id" : "variant_ilx_0101431",
"organization" : "Interlex Lab 2",
"description" : "The central nervous system is the part of the nervous system...",
"timestamp" : "25 March 12:08am",
"status" : "Active",
"originatingUser" : {
"userID" : "olivia",
"userName" : "Oliviya Rhye"
},
"editingUser" : {
"userID" : "olivia",
"userName" : "Oliviya Rhye"
},
"url" : "https://uri.olympiangods.org/base/ilx_0101431.jsonld",
}
]
default:
description: unexpected error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/{group}/variant/{term}:
get:
summary: Get variant for a term
summary: List all variants for a term
operationId: get_variant
tags:
- term
Expand All @@ -716,7 +644,7 @@ paths:
type: string
responses:
200:
description: An object with the variant
description: A variant of a term
headers:
x-next:
description: A link to the next page of responses
Expand All @@ -725,24 +653,7 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/Variants'
example:
{
"id" : "variant_ilx_0101901",
"organization" : "Interlex Lab",
"description" : "The central nervous system is the part of the nervous system...",
"timestamp" : "24 March 12:08am",
"status" : "Active",
"originatingUser" : {
"userID" : "olivia",
"userName" : "Oliviya Rhye"
},
"editingUser" : {
"userID" : "olivia",
"userName" : "Oliviya Rhye"
},
"url" : "https://uri.olympiangods.org/base/ilx_0101901.jsonld",
}
$ref: '#/components/schemas/Variant'
default:
description: unexpected error
content:
Expand Down Expand Up @@ -1221,53 +1132,8 @@ components:
example: "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
Variant:
type: object
required:
- organization
- description
- timestamp
- status
- originatingUser
- editingUser
- url
properties:
id:
type: string
organization:
type: string
description:
type: string
timestamp:
type: string
status:
type: string
originatingUser:
type: object,
required:
userId
userName
properties:
userId:
type: string,
example: "olivia"
userName:
type: string,
example: "Oliviya Rhye"
editingUser:
type: object,
required:
userId
userName
properties:
userId:
type: string,
example: "olivia"
userName:
type: string,
example: "Oliviya Rhye"
url:
type: string
format: uri,
example: "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
items:
$ref: '#/components/schemas/Term'
Variants:
type: array
items:
Expand Down
138 changes: 75 additions & 63 deletions mock/data/mockVariants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,68 +35,80 @@ export const mockVariants = () => [

export const mockVariant = () => {
return {
"id": "http://uri.interlex.org/base/ilx_0101431",
"description": "It is an organization. It is derived from the anterior part of the embryonic neural tube (or the encephalon). Does not include retina. (CUMBO)The rostral topographic division of the cerebrospinal axis, while the caudal division is the spinal cord. The usual criterion for distinguishing the two divisions in the adult is that the vertebrate brain lies within the skull whereas the spinal cord lies within the spinal (vertebral) column, although this is a difficult problem. (Swanson, 2014)",
"existingID": ["http://uri.neuinfo.org/nif/nifstd/birnlex_796", "http://purl.org/sig/ont/fma/fma50801", "UBERON:0001017"],
"hasIlxId": "http://uri.interlex.org/base/ilx_0101431",
"hasIlxPreferredId": "http://uri.interlex.org/base/ilx_0101431",
"label": "Brain",
"organization": "My Organization",
"predicates": [
{"title": "@id", "count": 3, "tableData": [
{"subject": "http://uri.interlex.org/base/ilx_0101431", "predicate": "@id", "object": "http://uri.interlex.org/base/ilx_0101431"},
{"subject": "http://uri.interlex.org/base/ontologies/ilx_0101431", "predicate": "@id", "object": "http://uri.interlex.org/base/ontologies/ilx_0101431"},
{"subject": "http://purl.obolibrary.org/obo/UBERON_0000955", "predicate": "@id", "object": "http://purl.obolibrary.org/obo/UBERON_0000955"}
]},
{"title": "http://uri.interlex.org/tgbugs/uris/readable/hasIlxId", "count": 1, "tableData": [
{"subject": "http://uri.interlex.org/base/ilx_0101431", "predicate": "http://uri.interlex.org/tgbugs/uris/readable/hasIlxId", "object": "http://uri.interlex.org/base/ilx_0101431"}
]},
{"title": "http://uri.interlex.org/tgbugs/uris/readable/hasIlxPreferredId", "count": 1, "tableData": [
{"subject": "http://uri.interlex.org/base/ilx_0101431","object": "http://uri.interlex.org/base/ilx_0101431","predicate": "http://uri.interlex.org/tgbugs/uris/readable/hasIlxPreferredId"}
]},
{"title": "@type", "count": 2, "tableData": [
{"subject": "http://uri.interlex.org/base/ontologies/ilx_0101431", "predicate": "@type", "object": "owl:Ontology"},
{"subject": "http://purl.obolibrary.org/obo/UBERON_0000955", "predicate": "@type", "object": "owl:Class"}
]},
{"title": "owl:versionIRI", "count": 1, "tableData": [
{"subject": "http://uri.interlex.org/base/ontologies/ilx_0101431", "predicate": "owl:versionIRI", "object": "http://uri.interlex.org/base/ontologies/ilx_0101431/version/1717611398/ilx_0101431"}
]},
{"title": "owl:versionInfo", "count": 1, "tableData": [
{"subject": "http://uri.interlex.org/base/ontologies/ilx_0101431", "predicate": "owl:versionInfo", "object": "2024-06-05T18:16:38,089335Z"}
]},
{"title": "http://purl.obolibrary.org/obo/IAO_0000115", "count": 1, "tableData": [
{"subject": "http://purl.obolibrary.org/obo/UBERON_0000955", "predicate": "http://purl.obolibrary.org/obo/IAO_0000115", "object": "The part of the central nervous system contained w…ough this is a difficult problem. (Swanson, 2014)"}
]},
{"title": "http://uri.interlex.org/base/readable/synonym", "count": 5, "tableData": [
{"subject": "http://purl.obolibrary.org/obo/UBERON_0000955", "predicate": "http://uri.interlex.org/base/readable/synonym", "object": "Encephalon"},
{"subject": "http://purl.obolibrary.org/obo/UBERON_0000955", "predicate": "http://uri.interlex.org/base/readable/synonym", "object": "synganglion"},
{"subject": "http://purl.obolibrary.org/obo/UBERON_0000955", "predicate": "http://uri.interlex.org/base/readable/synonym", "object": "the brain"},
{"subject": "http://purl.obolibrary.org/obo/UBERON_0000955", "predicate": "http://uri.interlex.org/base/readable/synonym", "object": "suprasegmental levels of nervous system"},
{"subject": "http://purl.obolibrary.org/obo/UBERON_0000955", "predicate": "http://uri.interlex.org/base/readable/synonym", "object": "suprasegmental structures"}
]},
{"title": "http://uri.interlex.org/tgbugs/uris/readable/hasExistingId", "count": 3, "tableData": [
{"subject": "http://purl.obolibrary.org/obo/UBERON_0000955", "predicate": "http://uri.interlex.org/tgbugs/uris/readable/hasExistingId", "object": "http://uri.neuinfo.org/nif/nifstd/birnlex_796"},
{"subject": "http://purl.obolibrary.org/obo/UBERON_0000955", "predicate": "http://uri.interlex.org/tgbugs/uris/readable/hasExistingId", "object": "http://purl.org/sig/ont/fma/fma50801"},
{"subject": "http://purl.obolibrary.org/obo/UBERON_0000955", "predicate": "http://uri.interlex.org/tgbugs/uris/readable/hasExistingId", "object": "http://purl.obolibrary.org/obo/UBERON_0000955"}
]},
{"title": "http://uri.interlex.org/tgbugs/uris/readable/organization", "count": 1, "tableData": [
{"subject": "http://purl.obolibrary.org/obo/UBERON_0000955", "predicate": "http://uri.interlex.org/tgbugs/uris/readable/organization", "object": "My Organization"}
]},
{"title": "http://uri.interlex.org/tgbugs/uris/readable/status", "count": 1, "tableData": [
{"subject": "http://purl.obolibrary.org/obo/UBERON_0000955", "predicate": "http://uri.interlex.org/tgbugs/uris/readable/status", "object": "Approved"}
]},
{"title": "rdfs:label", "count": 1, "tableData": [
{"subject": "http://purl.obolibrary.org/obo/UBERON_0000955", "predicate": "rdfs:label", "object": "Brain"}
]},
{"title": "rdfs:subClassOf", "count": 1, "tableData": [
{"subject": "http://purl.obolibrary.org/obo/UBERON_0000955", "predicate": "rdfs:subClassOf", "object": "http://uri.interlex.org/base/ilx_0108124"}
]}
],
"status": "Approved",
"subClassOf": "http://uri.interlex.org/base/ilx_0108124",
"synonym": ["Encephalon", "synganglion", "the brain", "suprasegmental structures", "structure"],
"type": "owl:Ontology",
"versionIRI": "http://uri.interlex.org/base/ontologies/ilx_0101431/version/1717611398/ilx_0101431",
"versionInfo": "2024-06-05T18:16:38,089335Z"
"@context": {
"owl": "http://www.w3.org/2002/07/owl#",
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
"xsd": "http://www.w3.org/2001/XMLSchema#"
},
"@graph": [
{
"@id": "http://uri.interlex.org/base/ilx_0101431",
"http://uri.interlex.org/tgbugs/uris/readable/hasIlxId": {
"@id": "http://uri.interlex.org/base/ilx_0101431"
},
"http://uri.interlex.org/tgbugs/uris/readable/hasIlxPreferredId": {
"@id": "http://uri.interlex.org/base/ilx_0101431"
},
"http://uri.interlex.org/tgbugs/uris/readable/owlEquivalent": "owlEquivalent",
"http://uri.interlex.org/tgbugs/uris/readable/lastModify": "Today",
"http://uri.interlex.org/tgbugs/uris/readable/lastModifyBy": "User 1",
"http://uri.interlex.org/tgbugs/uris/readable/submittedBy": "Dec 12, 202"
},
{
"@id": "http://uri.interlex.org/base/ontologies/ilx_0101431",
"@type": "owl:Ontology",
"http://purl.obolibrary.org/obo/IAO_0000136": {
"@id": "http://uri.interlex.org/base/ilx_0101431"
},
"owl:versionIRI": {
"@id": "http://uri.interlex.org/base/ontologies/ilx_0101431/version/1717611398/ilx_0101431"
},
"owl:versionInfo": "2024-12-12T18:16:38,089335Z",
"rdfs:comment": "InterLex single term result for base/ilx_0101431 at 2024-06-05T18:16:38,089335Z"
},
{
"@id": "http://purl.obolibrary.org/obo/UBERON_0000955",
"@type": "owl:Class",
"http://purl.obolibrary.org/obo/IAO_0000115": "The part of the central nervous system contained within the cranium, comprising the forebrain, midbrain, hindbrain, and metencephalon. It is derived from the anterior part of the embryonic neural tube (or the encephalon). Does not include retina. (CUMBO)The rostral topographic division of the cerebrospinal axis, while the caudal division is the spinal cord. The usual criterion for distinguishing the two divisions in the adult is that the vertebrate brain lies within the skull whereas the spinal cord lies within the spinal (vertebral) column, although this is a difficult problem. (Swanson, 2014)",
"http://uri.interlex.org/base/ilx_0112784": {
"@id": "http://uri.interlex.org/base/ilx_0102661"
},
"http://uri.interlex.org/base/ilx_0112785": {
"@id": "http://uri.interlex.org/base/ilx_0101999"
},
"http://uri.interlex.org/base/ilx_0112796": {
"@id": "http://uri.interlex.org/base/ilx_0101901"
},
"http://uri.interlex.org/base/readable/synonym": [
"Encephalon",
"synganglion",
"the brain",
"suprasegmental levels of nervous system",
"suprasegmental structures"
],
"http://uri.interlex.org/tgbugs/uris/readable/MISSING_ILX_ID": true,
"http://uri.interlex.org/tgbugs/uris/readable/hasExistingId": [
{
"@id": "http://uri.neuinfo.org/nif/nifstd/birnlex_796"
},
{
"@id": "http://purl.org/sig/ont/fma/fma50801"
},
{
"@id": "http://purl.obolibrary.org/obo/UBERON_0000955"
},
{
"@id": "http://purl.obolibrary.org/obo/UBERON_0000956"
}
],
"http://uri.interlex.org/tgbugs/uris/readable/organization": "My Organization",
"http://uri.interlex.org/tgbugs/uris/readable/status": "Approved",
"rdfs:label": "Brain",
"rdfs:subClassOf": {
"@id": "http://uri.interlex.org/base/ilx_0108124"
}
}
]
}
}
Loading