datalad / datalad-ebrains

DataLad extension to interface with the neuroinformatics platform of the Human Brain Project
Other
3 stars 5 forks source link

Update to new KG version and query abilities #20

Closed mih closed 2 years ago

mih commented 2 years ago

Here is some demo code:

https://github.com/FZJ-INM1-BDA/siibra-python/blob/d4289801e3abaa252279b9c617c5744b733fe6b5/siibra/retrieval/repositories.py#L264

and here is a demo openminds query:

{
  "@context": {
    "@vocab": "https://core.kg.ebrains.eu/vocab/query/",
    "query": "https://schema.hbp.eu/myQuery/",
    "propertyName": {
      "@id": "propertyName",
      "@type": "@id"
    },
    "merge": {
      "@type": "@id",
      "@id": "merge"
    },
    "path": {
      "@id": "path",
      "@type": "@id"
    }
  },
  "meta": {
    "type": "https://openminds.ebrains.eu/core/Dataset",
    "responseVocab": "https://schema.hbp.eu/myQuery/"
  },
  "structure": [
    {
      "propertyName": "id",
      "path": "@id",
      "filter": {
        "op": "ENDS_WITH",
        "parameter": "dataset_id"
      }
    },
    {
      "propertyName": "name",
      "path": "https://openminds.ebrains.eu/vocab/fullName"
    },
    {
      "propertyName": "versions",
      "path": "https://openminds.ebrains.eu/vocab/hasVersion",
      "structure": [
        {
          "propertyName": "id",
          "path": "@id"
        },
        {
          "propertyName": "name",
          "path": "https://openminds.ebrains.eu/vocab/fullName"
        },
        {
          "propertyName": "authors",
          "path": "https://openminds.ebrains.eu/vocab/author",
          "structure": [
            {
              "propertyName": "familyName",
              "path": "https://openminds.ebrains.eu/vocab/familyName"
            },
            {
              "propertyName": "givenName",
              "path": "https://openminds.ebrains.eu/vocab/givenName"
            }
          ]
        },
        {
          "propertyName": "releaseDate",
          "path": "https://openminds.ebrains.eu/vocab/releaseDate"
        },
        {
          "propertyName": "versionIdentifier",
          "path": "https://openminds.ebrains.eu/vocab/versionIdentifier"
        },
        {
          "propertyName": "files",
          "path": [
            "https://openminds.ebrains.eu/vocab/repository",
            {
              "@id": "https://openminds.ebrains.eu/vocab/fileRepository",
              "reverse": true
            }
          ],
          "structure": [
            {
              "propertyName": "id",
              "path": "@id"
            },
            {
              "propertyName": "url",
              "path": "https://openminds.ebrains.eu/vocab/IRI"
            },
            {
              "propertyName": "type",
              "path": "@type"
            },
            {
              "propertyName": "name",
              "path": "https://openminds.ebrains.eu/vocab/name"
            }
          ]
        },
        {
          "propertyName": "copyright",
          "path": "https://openminds.ebrains.eu/vocab/copyright"
        },
        {
          "propertyName": "license",
          "path": "https://openminds.ebrains.eu/vocab/license"
        },
        {
          "propertyName": "publications",
          "path": "https://openminds.ebrains.eu/vocab/relatedPublication"
        }
      ]
    }
  ]
}