diff --git a/examples/notebooks/getting-started/04 - Querying.ipynb b/examples/notebooks/getting-started/04 - Querying.ipynb index 4ac9d487..e2bd0fc1 100644 --- a/examples/notebooks/getting-started/04 - Querying.ipynb +++ b/examples/notebooks/getting-started/04 - Querying.ipynb @@ -1,6 +1,7 @@ { "cells": [ { + "attachments": {}, "cell_type": "markdown", "metadata": { "ExecuteTime": { @@ -29,6 +30,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -45,6 +47,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -63,6 +66,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -70,6 +74,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -133,6 +138,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -363,6 +369,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -387,18 +394,18 @@ { "data": { "text/plain": [ - "{'id': 'https://sandbox.bluebrainnexus.io/v1/resources/github-users/crisely09/_/de7fcd9a-7fdc-4097-8c5a-74bc85cb555d',\n", + "{'id': 'https://sandbox.bluebrainnexus.io/v1/resources/github-users/crisely09/_/4088d652-7b1c-42a9-9570-97ca23f4ec98',\n", " '_constrainedBy': 'https://bluebrain.github.io/nexus/schemas/unconstrained.json',\n", - " '_createdAt': '2023-01-25T13:31:49.657Z',\n", + " '_createdAt': '2023-05-22T08:57:55.754Z',\n", " '_createdBy': 'https://sandbox.bluebrainnexus.io/v1/realms/github/users/crisely09',\n", " '_deprecated': False,\n", - " '_incoming': 'https://sandbox.bluebrainnexus.io/v1/resources/github-users/crisely09/_/de7fcd9a-7fdc-4097-8c5a-74bc85cb555d/incoming',\n", - " '_outgoing': 'https://sandbox.bluebrainnexus.io/v1/resources/github-users/crisely09/_/de7fcd9a-7fdc-4097-8c5a-74bc85cb555d/outgoing',\n", + " '_incoming': 'https://sandbox.bluebrainnexus.io/v1/resources/github-users/crisely09/_/4088d652-7b1c-42a9-9570-97ca23f4ec98/incoming',\n", + " '_outgoing': 'https://sandbox.bluebrainnexus.io/v1/resources/github-users/crisely09/_/4088d652-7b1c-42a9-9570-97ca23f4ec98/outgoing',\n", " '_project': 'https://sandbox.bluebrainnexus.io/v1/projects/github-users/crisely09',\n", " '_rev': 3,\n", " '_schemaProject': 'https://sandbox.bluebrainnexus.io/v1/projects/github-users/crisely09',\n", - " '_self': 'https://sandbox.bluebrainnexus.io/v1/resources/github-users/crisely09/_/de7fcd9a-7fdc-4097-8c5a-74bc85cb555d',\n", - " '_updatedAt': '2023-01-25T13:31:50.140Z',\n", + " '_self': 'https://sandbox.bluebrainnexus.io/v1/resources/github-users/crisely09/_/4088d652-7b1c-42a9-9570-97ca23f4ec98',\n", + " '_updatedAt': '2023-05-22T08:57:56.380Z',\n", " '_updatedBy': 'https://sandbox.bluebrainnexus.io/v1/realms/github/users/crisely09'}" ] }, @@ -452,6 +459,108 @@ ] }, { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Retrieving using the resorce url\n", + "One can also use the value of `_self` from ._stote_metadata to retrieve a resource" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": {}, + "outputs": [], + "source": [ + "import copy" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": {}, + "outputs": [], + "source": [ + "other_resource = copy.deepcopy(resource)" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": {}, + "outputs": [], + "source": [ + "other_resource.id = \"https://myincreadibleid-987654321\"" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " _register_one\n", + " True\n" + ] + } + ], + "source": [ + "forge.register(other_resource)" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": {}, + "outputs": [], + "source": [ + "url = other_resource._store_metadata['_self']" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": {}, + "outputs": [], + "source": [ + "same_resource_url = forge.retrieve(id=url)\n", + "same_resource_id = forge.retrieve(id=other_resource.id)" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Confirm they are the same" + ] + }, + { + "cell_type": "code", + "execution_count": 132, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 132, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "same_resource_id == same_resource_url" + ] + }, + { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -461,7 +570,7 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": 34, "metadata": {}, "outputs": [], "source": [ @@ -470,20 +579,20 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": 35, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "{'id': 'https://sandbox.bluebrainnexus.io/v1/resources/github-users/crisely09/_/de7fcd9a-7fdc-4097-8c5a-74bc85cb555d',\n", + "{'id': 'https://sandbox.bluebrainnexus.io/v1/resources/github-users/crisely09/_/4088d652-7b1c-42a9-9570-97ca23f4ec98',\n", " 'type': 'Person',\n", " 'award': 'Nobel',\n", " 'email': ['jane.doe@epfl.ch', 'jane.doe@example.org'],\n", " 'name': 'Jane Doe'}" ] }, - "execution_count": 26, + "execution_count": 35, "metadata": {}, "output_type": "execute_result" } @@ -494,28 +603,28 @@ }, { "cell_type": "code", - "execution_count": 27, + "execution_count": 36, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "{'id': 'https://sandbox.bluebrainnexus.io/v1/resources/github-users/crisely09/_/de7fcd9a-7fdc-4097-8c5a-74bc85cb555d',\n", + "{'id': 'https://sandbox.bluebrainnexus.io/v1/resources/github-users/crisely09/_/4088d652-7b1c-42a9-9570-97ca23f4ec98',\n", " '_constrainedBy': 'https://bluebrain.github.io/nexus/schemas/unconstrained.json',\n", - " '_createdAt': '2023-01-25T13:31:49.657Z',\n", + " '_createdAt': '2023-05-22T08:57:55.754Z',\n", " '_createdBy': 'https://sandbox.bluebrainnexus.io/v1/realms/github/users/crisely09',\n", " '_deprecated': False,\n", - " '_incoming': 'https://sandbox.bluebrainnexus.io/v1/resources/github-users/crisely09/_/de7fcd9a-7fdc-4097-8c5a-74bc85cb555d/incoming',\n", - " '_outgoing': 'https://sandbox.bluebrainnexus.io/v1/resources/github-users/crisely09/_/de7fcd9a-7fdc-4097-8c5a-74bc85cb555d/outgoing',\n", + " '_incoming': 'https://sandbox.bluebrainnexus.io/v1/resources/github-users/crisely09/_/4088d652-7b1c-42a9-9570-97ca23f4ec98/incoming',\n", + " '_outgoing': 'https://sandbox.bluebrainnexus.io/v1/resources/github-users/crisely09/_/4088d652-7b1c-42a9-9570-97ca23f4ec98/outgoing',\n", " '_project': 'https://sandbox.bluebrainnexus.io/v1/projects/github-users/crisely09',\n", " '_rev': 3,\n", " '_schemaProject': 'https://sandbox.bluebrainnexus.io/v1/projects/github-users/crisely09',\n", - " '_self': 'https://sandbox.bluebrainnexus.io/v1/resources/github-users/crisely09/_/de7fcd9a-7fdc-4097-8c5a-74bc85cb555d',\n", - " '_updatedAt': '2023-01-25T13:31:50.140Z',\n", + " '_self': 'https://sandbox.bluebrainnexus.io/v1/resources/github-users/crisely09/_/4088d652-7b1c-42a9-9570-97ca23f4ec98',\n", + " '_updatedAt': '2023-05-22T08:57:56.380Z',\n", " '_updatedBy': 'https://sandbox.bluebrainnexus.io/v1/realms/github/users/crisely09'}" ] }, - "execution_count": 27, + "execution_count": 36, "metadata": {}, "output_type": "execute_result" } @@ -526,7 +635,7 @@ }, { "cell_type": "code", - "execution_count": 28, + "execution_count": 37, "metadata": {}, "outputs": [ { @@ -535,7 +644,7 @@ "Action(error=None, message=None, operation='retrieve', succeeded=True)" ] }, - "execution_count": 28, + "execution_count": 37, "metadata": {}, "output_type": "execute_result" } @@ -546,7 +655,7 @@ }, { "cell_type": "code", - "execution_count": 29, + "execution_count": 38, "metadata": {}, "outputs": [ { @@ -555,7 +664,7 @@ "True" ] }, - "execution_count": 29, + "execution_count": 38, "metadata": {}, "output_type": "execute_result" } @@ -565,6 +674,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -573,15 +683,15 @@ }, { "cell_type": "code", - "execution_count": 30, + "execution_count": 39, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - " retrieve\n", - " RetrievalError: 404 Client Error: Not Found for url: https://sandbox.bluebrainnexus.io/v1/resources/github-users/crisely09/_/%3A%2F%2F123/source\n", + " raise_for_status\n", + " HTTPError: 404 Client Error: Not Found for url: https://sandbox.bluebrainnexus.io/v1/resources/github-users/crisely09/_/%3A%2F%2F123\n", "\n" ] } @@ -592,7 +702,7 @@ }, { "cell_type": "code", - "execution_count": 31, + "execution_count": 40, "metadata": {}, "outputs": [ { @@ -601,7 +711,7 @@ "True" ] }, - "execution_count": 31, + "execution_count": 40, "metadata": {}, "output_type": "execute_result" } @@ -611,6 +721,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -618,6 +729,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -626,7 +738,7 @@ }, { "cell_type": "code", - "execution_count": 32, + "execution_count": 41, "metadata": {}, "outputs": [], "source": [ @@ -636,7 +748,7 @@ }, { "cell_type": "code", - "execution_count": 33, + "execution_count": 42, "metadata": {}, "outputs": [], "source": [ @@ -646,7 +758,7 @@ }, { "cell_type": "code", - "execution_count": 34, + "execution_count": 43, "metadata": {}, "outputs": [], "source": [ @@ -656,7 +768,7 @@ }, { "cell_type": "code", - "execution_count": 35, + "execution_count": 44, "metadata": {}, "outputs": [ { @@ -674,13 +786,13 @@ }, { "cell_type": "code", - "execution_count": 36, + "execution_count": 45, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "{'id': 'https://sandbox.bluebrainnexus.io/v1/resources/github-users/crisely09/_/ffb03ef3-5210-4c69-8980-72a5b339b3c3',\n", + "{'id': 'https://sandbox.bluebrainnexus.io/v1/resources/github-users/crisely09/_/5b59d793-d0de-42ec-a841-eac6e06707db',\n", " 'type': 'Dataset',\n", " 'contribution': [{'type': 'Contribution',\n", " 'agent': {'type': 'Person', 'name': 'Jane Doe'}},\n", @@ -691,14 +803,14 @@ " 'type': 'DiskStorage',\n", " '_rev': 1}},\n", " 'contentSize': {'unitCode': 'bytes', 'value': 477},\n", - " 'contentUrl': 'https://sandbox.bluebrainnexus.io/v1/files/github-users/crisely09/796d0a36-51b4-429f-9959-abb6dafc474f',\n", + " 'contentUrl': 'https://sandbox.bluebrainnexus.io/v1/files/github-users/crisely09/1f6d9e0d-a4e3-46de-b742-3665af2c6b53',\n", " 'digest': {'algorithm': 'SHA-256',\n", " 'value': '789aa07948683fe036ac29811814a826b703b562f7d168eb70dee1fabde26859'},\n", " 'encodingFormat': 'text/tab-separated-values',\n", " 'name': 'associations.tsv'}}" ] }, - "execution_count": 36, + "execution_count": 45, "metadata": {}, "output_type": "execute_result" } @@ -708,6 +820,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -715,6 +828,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -725,7 +839,7 @@ }, { "cell_type": "code", - "execution_count": 37, + "execution_count": 46, "metadata": {}, "outputs": [], "source": [ @@ -733,6 +847,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -740,6 +855,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -747,6 +863,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -755,7 +872,7 @@ }, { "cell_type": "code", - "execution_count": 41, + "execution_count": 47, "metadata": {}, "outputs": [], "source": [ @@ -764,7 +881,7 @@ }, { "cell_type": "code", - "execution_count": 42, + "execution_count": 48, "metadata": {}, "outputs": [ { @@ -773,7 +890,7 @@ "list" ] }, - "execution_count": 42, + "execution_count": 48, "metadata": {}, "output_type": "execute_result" } @@ -784,16 +901,16 @@ }, { "cell_type": "code", - "execution_count": 43, + "execution_count": 49, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "92" + "3" ] }, - "execution_count": 43, + "execution_count": 49, "metadata": {}, "output_type": "execute_result" } @@ -804,7 +921,7 @@ }, { "cell_type": "code", - "execution_count": 44, + "execution_count": 50, "metadata": {}, "outputs": [ { @@ -830,12 +947,7 @@ " \n", " id\n", " type\n", - " award\n", " name\n", - " email\n", - " address.type\n", - " address.country\n", - " address.locality\n", " distribution.type\n", " distribution.atLocation.type\n", " distribution.atLocation.store.id\n", @@ -855,12 +967,7 @@ " 0\n", " https://sandbox.bluebrainnexus.io/v1/resources...\n", " Person\n", - " [Nobel]\n", - " Jane Doe\n", - " NaN\n", - " NaN\n", - " NaN\n", - " NaN\n", + " Albert Einstein\n", " NaN\n", " NaN\n", " NaN\n", @@ -878,12 +985,7 @@ " 1\n", " https://sandbox.bluebrainnexus.io/v1/resources...\n", " Person\n", - " [Nobel]\n", - " Jane Doe\n", - " [jane.doe@epfl.ch, jane.doe@example.org]\n", - " NaN\n", - " NaN\n", - " NaN\n", + " Marie Curie\n", " NaN\n", " NaN\n", " NaN\n", @@ -901,14 +1003,143 @@ " 2\n", " https://sandbox.bluebrainnexus.io/v1/resources...\n", " Person\n", - " [Nobel]\n", " Jane Doe\n", - " NaN\n", - " NaN\n", - " NaN\n", - " NaN\n", - " NaN\n", - " NaN\n", + " DataDownload\n", + " Location\n", + " https://bluebrain.github.io/nexus/vocabulary/d...\n", + " DiskStorage\n", + " 1.0\n", + " bytes\n", + " 477.0\n", + " https://sandbox.bluebrainnexus.io/v1/files/git...\n", + " SHA-256\n", + " 789aa07948683fe036ac29811814a826b703b562f7d168...\n", + " text/tab-separated-values\n", + " associations.tsv\n", + " \n", + " \n", + "\n", + "" + ], + "text/plain": [ + " id type name \\\n", + "0 https://sandbox.bluebrainnexus.io/v1/resources... Person Albert Einstein \n", + "1 https://sandbox.bluebrainnexus.io/v1/resources... Person Marie Curie \n", + "2 https://sandbox.bluebrainnexus.io/v1/resources... Person Jane Doe \n", + "\n", + " distribution.type distribution.atLocation.type \\\n", + "0 NaN NaN \n", + "1 NaN NaN \n", + "2 DataDownload Location \n", + "\n", + " distribution.atLocation.store.id \\\n", + "0 NaN \n", + "1 NaN \n", + "2 https://bluebrain.github.io/nexus/vocabulary/d... \n", + "\n", + " distribution.atLocation.store.type distribution.atLocation.store._rev \\\n", + "0 NaN NaN \n", + "1 NaN NaN \n", + "2 DiskStorage 1.0 \n", + "\n", + " distribution.contentSize.unitCode distribution.contentSize.value \\\n", + "0 NaN NaN \n", + "1 NaN NaN \n", + "2 bytes 477.0 \n", + "\n", + " distribution.contentUrl \\\n", + "0 NaN \n", + "1 NaN \n", + "2 https://sandbox.bluebrainnexus.io/v1/files/git... \n", + "\n", + " distribution.digest.algorithm \\\n", + "0 NaN \n", + "1 NaN \n", + "2 SHA-256 \n", + "\n", + " distribution.digest.value \\\n", + "0 NaN \n", + "1 NaN \n", + "2 789aa07948683fe036ac29811814a826b703b562f7d168... \n", + "\n", + " distribution.encodingFormat distribution.name \n", + "0 NaN NaN \n", + "1 NaN NaN \n", + "2 text/tab-separated-values associations.tsv " + ] + }, + "execution_count": 50, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "forge.as_dataframe(resources)" + ] + }, + { + "cell_type": "code", + "execution_count": 51, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", " \n", @@ -921,109 +1152,18 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", " \n", @@ -1036,200 +1176,190 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", - " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", "
idtypename_constrainedBy_createdAt_createdBy_deprecated_incoming_outgoing_project...distribution.atLocation.store.iddistribution.atLocation.store.typedistribution.atLocation.store._revdistribution.contentSize.unitCodedistribution.contentSize.valuedistribution.contentUrldistribution.digest.algorithmdistribution.digest.valuedistribution.encodingFormatdistribution.name
0https://sandbox.bluebrainnexus.io/v1/resources...PersonAlbert Einsteinhttps://bluebrain.github.io/nexus/schemas/unco...2022-07-20T15:30:01.482Zhttps://sandbox.bluebrainnexus.io/v1/realms/gi...Falsehttps://sandbox.bluebrainnexus.io/v1/resources...https://sandbox.bluebrainnexus.io/v1/resources...https://sandbox.bluebrainnexus.io/v1/projects/......NaNNaNNaNNaN
31https://sandbox.bluebrainnexus.io/v1/resources...Person[Nobel]Jane Doe[jane.doe@epfl.ch, jane.doe@example.org]NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
4https://sandbox.bluebrainnexus.io/v1/resources...Person[Nobel]Jane DoeNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
...............................................................
87Marie Curiehttps://bluebrain.github.io/nexus/schemas/unco...2022-07-20T15:30:01.467Zhttps://sandbox.bluebrainnexus.io/v1/realms/gi...Falsehttps://sandbox.bluebrainnexus.io/v1/resources...Person[Nobel]Jane Doe[jane.doe@epfl.ch, jane.doe@example.org]NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
88https://sandbox.bluebrainnexus.io/v1/resources...Person[Nobel]Jane DoeNaNNaNNaNNaNNaNNaNhttps://sandbox.bluebrainnexus.io/v1/projects/......NaNNaNNaNNaN
892https://sandbox.bluebrainnexus.io/v1/resources...Person[Nobel]Jane Doe[jane.doe@epfl.ch, jane.doe@example.org]NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
90https://bluebrain.github.io/nexus/schemas/unco...2022-07-20T15:27:50.435Zhttps://sandbox.bluebrainnexus.io/v1/realms/gi...Falsehttps://sandbox.bluebrainnexus.io/v1/resources...Person[Nobel]Jane DoeNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
91https://sandbox.bluebrainnexus.io/v1/resources...Person[Nobel]Jane Doe[jane.doe@epfl.ch, jane.doe@example.org]NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNhttps://sandbox.bluebrainnexus.io/v1/projects/......https://bluebrain.github.io/nexus/vocabulary/d...DiskStorage1.0bytes477.0https://sandbox.bluebrainnexus.io/v1/files/git...SHA-256789aa07948683fe036ac29811814a826b703b562f7d168...text/tab-separated-valuesassociations.tsv
\n", - "

92 rows × 20 columns

\n", + "

3 rows × 27 columns

\n", "
" ], "text/plain": [ - " id type award \\\n", - "0 https://sandbox.bluebrainnexus.io/v1/resources... Person [Nobel] \n", - "1 https://sandbox.bluebrainnexus.io/v1/resources... Person [Nobel] \n", - "2 https://sandbox.bluebrainnexus.io/v1/resources... Person [Nobel] \n", - "3 https://sandbox.bluebrainnexus.io/v1/resources... Person [Nobel] \n", - "4 https://sandbox.bluebrainnexus.io/v1/resources... Person [Nobel] \n", - ".. ... ... ... \n", - "87 https://sandbox.bluebrainnexus.io/v1/resources... Person [Nobel] \n", - "88 https://sandbox.bluebrainnexus.io/v1/resources... Person [Nobel] \n", - "89 https://sandbox.bluebrainnexus.io/v1/resources... Person [Nobel] \n", - "90 https://sandbox.bluebrainnexus.io/v1/resources... Person [Nobel] \n", - "91 https://sandbox.bluebrainnexus.io/v1/resources... Person [Nobel] \n", + " id type name \\\n", + "0 https://sandbox.bluebrainnexus.io/v1/resources... Person Albert Einstein \n", + "1 https://sandbox.bluebrainnexus.io/v1/resources... Person Marie Curie \n", + "2 https://sandbox.bluebrainnexus.io/v1/resources... Person Jane Doe \n", + "\n", + " _constrainedBy \\\n", + "0 https://bluebrain.github.io/nexus/schemas/unco... \n", + "1 https://bluebrain.github.io/nexus/schemas/unco... \n", + "2 https://bluebrain.github.io/nexus/schemas/unco... \n", + "\n", + " _createdAt \\\n", + "0 2022-07-20T15:30:01.482Z \n", + "1 2022-07-20T15:30:01.467Z \n", + "2 2022-07-20T15:27:50.435Z \n", + "\n", + " _createdBy _deprecated \\\n", + "0 https://sandbox.bluebrainnexus.io/v1/realms/gi... False \n", + "1 https://sandbox.bluebrainnexus.io/v1/realms/gi... False \n", + "2 https://sandbox.bluebrainnexus.io/v1/realms/gi... False \n", + "\n", + " _incoming \\\n", + "0 https://sandbox.bluebrainnexus.io/v1/resources... \n", + "1 https://sandbox.bluebrainnexus.io/v1/resources... \n", + "2 https://sandbox.bluebrainnexus.io/v1/resources... \n", + "\n", + " _outgoing \\\n", + "0 https://sandbox.bluebrainnexus.io/v1/resources... \n", + "1 https://sandbox.bluebrainnexus.io/v1/resources... \n", + "2 https://sandbox.bluebrainnexus.io/v1/resources... \n", "\n", - " name email address.type \\\n", - "0 Jane Doe NaN NaN \n", - "1 Jane Doe [jane.doe@epfl.ch, jane.doe@example.org] NaN \n", - "2 Jane Doe NaN NaN \n", - "3 Jane Doe [jane.doe@epfl.ch, jane.doe@example.org] NaN \n", - "4 Jane Doe NaN NaN \n", - ".. ... ... ... \n", - "87 Jane Doe [jane.doe@epfl.ch, jane.doe@example.org] NaN \n", - "88 Jane Doe NaN NaN \n", - "89 Jane Doe [jane.doe@epfl.ch, jane.doe@example.org] NaN \n", - "90 Jane Doe NaN NaN \n", - "91 Jane Doe [jane.doe@epfl.ch, jane.doe@example.org] NaN \n", + " _project ... \\\n", + "0 https://sandbox.bluebrainnexus.io/v1/projects/... ... \n", + "1 https://sandbox.bluebrainnexus.io/v1/projects/... ... \n", + "2 https://sandbox.bluebrainnexus.io/v1/projects/... ... \n", + "\n", + " distribution.atLocation.store.id \\\n", + "0 NaN \n", + "1 NaN \n", + "2 https://bluebrain.github.io/nexus/vocabulary/d... \n", "\n", - " address.country address.locality distribution.type \\\n", - "0 NaN NaN NaN \n", - "1 NaN NaN NaN \n", - "2 NaN NaN NaN \n", - "3 NaN NaN NaN \n", - "4 NaN NaN NaN \n", - ".. ... ... ... \n", - "87 NaN NaN NaN \n", - "88 NaN NaN NaN \n", - "89 NaN NaN NaN \n", - "90 NaN NaN NaN \n", - "91 NaN NaN NaN \n", + " distribution.atLocation.store.type distribution.atLocation.store._rev \\\n", + "0 NaN NaN \n", + "1 NaN NaN \n", + "2 DiskStorage 1.0 \n", "\n", - " distribution.atLocation.type distribution.atLocation.store.id \\\n", - "0 NaN NaN \n", - "1 NaN NaN \n", - "2 NaN NaN \n", - "3 NaN NaN \n", - "4 NaN NaN \n", - ".. ... ... \n", - "87 NaN NaN \n", - "88 NaN NaN \n", - "89 NaN NaN \n", - "90 NaN NaN \n", - "91 NaN NaN \n", + " distribution.contentSize.unitCode distribution.contentSize.value \\\n", + "0 NaN NaN \n", + "1 NaN NaN \n", + "2 bytes 477.0 \n", "\n", - " distribution.atLocation.store.type distribution.atLocation.store._rev \\\n", - "0 NaN NaN \n", - "1 NaN NaN \n", - "2 NaN NaN \n", - "3 NaN NaN \n", - "4 NaN NaN \n", - ".. ... ... \n", - "87 NaN NaN \n", - "88 NaN NaN \n", - "89 NaN NaN \n", - "90 NaN NaN \n", - "91 NaN NaN \n", + " distribution.contentUrl \\\n", + "0 NaN \n", + "1 NaN \n", + "2 https://sandbox.bluebrainnexus.io/v1/files/git... \n", "\n", - " distribution.contentSize.unitCode distribution.contentSize.value \\\n", - "0 NaN NaN \n", - "1 NaN NaN \n", - "2 NaN NaN \n", - "3 NaN NaN \n", - "4 NaN NaN \n", - ".. ... ... \n", - "87 NaN NaN \n", - "88 NaN NaN \n", - "89 NaN NaN \n", - "90 NaN NaN \n", - "91 NaN NaN \n", + " distribution.digest.algorithm \\\n", + "0 NaN \n", + "1 NaN \n", + "2 SHA-256 \n", "\n", - " distribution.contentUrl distribution.digest.algorithm \\\n", - "0 NaN NaN \n", - "1 NaN NaN \n", - "2 NaN NaN \n", - "3 NaN NaN \n", - "4 NaN NaN \n", - ".. ... ... \n", - "87 NaN NaN \n", - "88 NaN NaN \n", - "89 NaN NaN \n", - "90 NaN NaN \n", - "91 NaN NaN \n", + " distribution.digest.value \\\n", + "0 NaN \n", + "1 NaN \n", + "2 789aa07948683fe036ac29811814a826b703b562f7d168... \n", "\n", - " distribution.digest.value distribution.encodingFormat distribution.name \n", - "0 NaN NaN NaN \n", - "1 NaN NaN NaN \n", - "2 NaN NaN NaN \n", - "3 NaN NaN NaN \n", - "4 NaN NaN NaN \n", - ".. ... ... ... \n", - "87 NaN NaN NaN \n", - "88 NaN NaN NaN \n", - "89 NaN NaN NaN \n", - "90 NaN NaN NaN \n", - "91 NaN NaN NaN \n", + " distribution.encodingFormat distribution.name \n", + "0 NaN NaN \n", + "1 NaN NaN \n", + "2 text/tab-separated-values associations.tsv \n", "\n", - "[92 rows x 20 columns]" + "[3 rows x 27 columns]" ] }, - "execution_count": 44, + "execution_count": 51, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "forge.as_dataframe(resources)" + "forge.as_dataframe(resources, store_metadata=True)" ] }, { "cell_type": "code", - "execution_count": 45, + "execution_count": 52, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "False" + ] + }, + "execution_count": 52, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Search results are not synchronized\n", + "resources[0]._synchronized" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Using nested resource property" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Property autocompletion is available on a path `p` even for nested properties like `p.contribution`." + ] + }, + { + "cell_type": "code", + "execution_count": 53, + "metadata": {}, + "outputs": [], + "source": [ + "# Search for resources of type Dataset and with text/tab-separated-values as distribution.encodingFormat\n", + "resources = forge.search(p.type.id == \"Dataset\", p.distribution.encodingFormat == \"text/tab-separated-values\", limit=3)" + ] + }, + { + "cell_type": "code", + "execution_count": 54, "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "3" + ] + }, + "execution_count": 54, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "len(resources)" + ] + }, + { + "cell_type": "code", + "execution_count": 55, + "metadata": { + "scrolled": true + }, "outputs": [ { "data": { @@ -1254,17 +1384,11 @@ " \n", " id\n", " type\n", - " award\n", - " name\n", - " _constrainedBy\n", - " _createdAt\n", - " _createdBy\n", - " _deprecated\n", - " _incoming\n", - " _outgoing\n", - " ...\n", - " distribution.atLocation.store.id\n", - " distribution.atLocation.store.type\n", + " contribution\n", + " distribution.type\n", + " distribution.atLocation.type\n", + " distribution.atLocation.store.id\n", + " distribution.atLocation.store.type\n", " distribution.atLocation.store._rev\n", " distribution.contentSize.unitCode\n", " distribution.contentSize.value\n", @@ -1279,420 +1403,316 @@ " \n", " 0\n", " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " Person\n", - " [Nobel]\n", - " Jane Doe\n", - " https://bluebrain.github.io/nexus/schemas/unco...\n", - " 2023-01-25T13:18:06.856Z\n", - " https://sandbox.bluebrainnexus.io/v1/realms/gi...\n", - " False\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " ...\n", - " NaN\n", - " NaN\n", - " NaN\n", - " NaN\n", - " NaN\n", - " NaN\n", - " NaN\n", - " NaN\n", - " NaN\n", - " NaN\n", + " Dataset\n", + " [{'type': 'Contribution', 'agent': {'type': 'P...\n", + " DataDownload\n", + " Location\n", + " https://bluebrain.github.io/nexus/vocabulary/d...\n", + " DiskStorage\n", + " 1\n", + " bytes\n", + " 477\n", + " https://sandbox.bluebrainnexus.io/v1/files/git...\n", + " SHA-256\n", + " 789aa07948683fe036ac29811814a826b703b562f7d168...\n", + " text/tab-separated-values\n", + " associations.tsv\n", " \n", " \n", " 1\n", " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " Person\n", - " [Nobel]\n", - " Jane Doe\n", - " https://bluebrain.github.io/nexus/schemas/unco...\n", - " 2023-01-25T13:18:07.458Z\n", - " https://sandbox.bluebrainnexus.io/v1/realms/gi...\n", - " False\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " ...\n", - " NaN\n", - " NaN\n", - " NaN\n", - " NaN\n", - " NaN\n", - " NaN\n", - " NaN\n", - " NaN\n", - " NaN\n", - " NaN\n", + " Dataset\n", + " [{'type': 'Contribution', 'agent': {'type': 'P...\n", + " DataDownload\n", + " Location\n", + " https://bluebrain.github.io/nexus/vocabulary/d...\n", + " DiskStorage\n", + " 1\n", + " bytes\n", + " 477\n", + " https://sandbox.bluebrainnexus.io/v1/files/git...\n", + " SHA-256\n", + " 789aa07948683fe036ac29811814a826b703b562f7d168...\n", + " text/tab-separated-values\n", + " associations.tsv\n", " \n", " \n", " 2\n", " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " Person\n", - " [Nobel]\n", - " Jane Doe\n", - " https://bluebrain.github.io/nexus/schemas/unco...\n", - " 2023-01-25T13:24:17.096Z\n", + " Dataset\n", + " [{'type': 'Contribution', 'agent': {'type': 'P...\n", + " DataDownload\n", + " Location\n", + " https://bluebrain.github.io/nexus/vocabulary/d...\n", + " DiskStorage\n", + " 1\n", + " bytes\n", + " 477\n", + " https://sandbox.bluebrainnexus.io/v1/files/git...\n", + " SHA-256\n", + " 789aa07948683fe036ac29811814a826b703b562f7d168...\n", + " text/tab-separated-values\n", + " associations.tsv\n", + " \n", + " \n", + "\n", + "" + ], + "text/plain": [ + " id type \\\n", + "0 https://sandbox.bluebrainnexus.io/v1/resources... Dataset \n", + "1 https://sandbox.bluebrainnexus.io/v1/resources... Dataset \n", + "2 https://sandbox.bluebrainnexus.io/v1/resources... Dataset \n", + "\n", + " contribution distribution.type \\\n", + "0 [{'type': 'Contribution', 'agent': {'type': 'P... DataDownload \n", + "1 [{'type': 'Contribution', 'agent': {'type': 'P... DataDownload \n", + "2 [{'type': 'Contribution', 'agent': {'type': 'P... DataDownload \n", + "\n", + " distribution.atLocation.type \\\n", + "0 Location \n", + "1 Location \n", + "2 Location \n", + "\n", + " distribution.atLocation.store.id \\\n", + "0 https://bluebrain.github.io/nexus/vocabulary/d... \n", + "1 https://bluebrain.github.io/nexus/vocabulary/d... \n", + "2 https://bluebrain.github.io/nexus/vocabulary/d... \n", + "\n", + " distribution.atLocation.store.type distribution.atLocation.store._rev \\\n", + "0 DiskStorage 1 \n", + "1 DiskStorage 1 \n", + "2 DiskStorage 1 \n", + "\n", + " distribution.contentSize.unitCode distribution.contentSize.value \\\n", + "0 bytes 477 \n", + "1 bytes 477 \n", + "2 bytes 477 \n", + "\n", + " distribution.contentUrl \\\n", + "0 https://sandbox.bluebrainnexus.io/v1/files/git... \n", + "1 https://sandbox.bluebrainnexus.io/v1/files/git... \n", + "2 https://sandbox.bluebrainnexus.io/v1/files/git... \n", + "\n", + " distribution.digest.algorithm \\\n", + "0 SHA-256 \n", + "1 SHA-256 \n", + "2 SHA-256 \n", + "\n", + " distribution.digest.value \\\n", + "0 789aa07948683fe036ac29811814a826b703b562f7d168... \n", + "1 789aa07948683fe036ac29811814a826b703b562f7d168... \n", + "2 789aa07948683fe036ac29811814a826b703b562f7d168... \n", + "\n", + " distribution.encodingFormat distribution.name \n", + "0 text/tab-separated-values associations.tsv \n", + "1 text/tab-separated-values associations.tsv \n", + "2 text/tab-separated-values associations.tsv " + ] + }, + "execution_count": 55, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "forge.as_dataframe(resources)" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Using dictionaries as filters\n", + "A dictionary can be provided for filters:\n", + "* {'type': {'id':'Dataset'}} is equivalent to p.type.id==\"Dataset\"\n", + "* only the '==' operator is supported\n", + "* nested dict are supported\n", + "* it is not mandatory for the provided properties and values to be defined in the forge model. Results will be retrieved if there are corresponding data in the store.\n", + "\n", + "This feature is not supported when using the DemoStore\n" + ] + }, + { + "cell_type": "code", + "execution_count": 56, + "metadata": {}, + "outputs": [], + "source": [ + "# Search for resources of type Dataset and with text/tab-separated-values as distribution.encodingFormat\n", + "# and created a given dateTime (by default, dateTime values should be signaled by the suffix \"^^xsd:dateTime\")\n", + "filters = {\n", + " \"type\": \"Dataset\", \n", + " \"distribution\":{\"encodingFormat\":\"text/tab-separated-values\"},\n", + " \"_createdAt\":dataset._store_metadata._createdAt+\"^^xsd:dateTime\"\n", + " }\n", + "resources = forge.search(filters, limit=3)" + ] + }, + { + "cell_type": "code", + "execution_count": 57, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "list" + ] + }, + "execution_count": 57, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "type(resources)" + ] + }, + { + "cell_type": "code", + "execution_count": 58, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "1" + ] + }, + "execution_count": 58, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "len(resources)" + ] + }, + { + "cell_type": "code", + "execution_count": 59, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", " \n", " \n", "
idtypecontributiondistribution.typedistribution.atLocation.typedistribution.atLocation.store.iddistribution.atLocation.store.typedistribution.atLocation.store._revdistribution.contentSize.unitCodedistribution.contentSize.value..._createdBy_deprecated_incoming_outgoing_project_rev_schemaProject_self_updatedAt_updatedBy
0https://sandbox.bluebrainnexus.io/v1/resources...Dataset[{'type': 'Contribution', 'agent': {'type': 'P...DataDownloadLocationhttps://bluebrain.github.io/nexus/vocabulary/d...DiskStorage1bytes477...https://sandbox.bluebrainnexus.io/v1/realms/gi...Falsehttps://sandbox.bluebrainnexus.io/v1/resources...https://sandbox.bluebrainnexus.io/v1/resources......NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
3https://sandbox.bluebrainnexus.io/v1/resources...Person[Nobel]Jane Doehttps://bluebrain.github.io/nexus/schemas/unco...2023-01-25T13:24:17.703Zhttps://sandbox.bluebrainnexus.io/v1/realms/gi...Falsehttps://sandbox.bluebrainnexus.io/v1/resources...https://sandbox.bluebrainnexus.io/v1/resources......NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
4https://sandbox.bluebrainnexus.io/v1/resources...Person[Nobel]Jane Doehttps://bluebrain.github.io/nexus/schemas/unco...2023-01-25T13:31:49.101Zhttps://sandbox.bluebrainnexus.io/v1/realms/gi...Falsehttps://sandbox.bluebrainnexus.io/v1/resources...https://sandbox.bluebrainnexus.io/v1/resources......NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
..................................................................
87https://sandbox.bluebrainnexus.io/v1/resources...Person[Nobel]Jane Doehttps://bluebrain.github.io/nexus/schemas/unco...2022-09-27T08:55:43.621Zhttps://sandbox.bluebrainnexus.io/v1/realms/gi...Falsehttps://sandbox.bluebrainnexus.io/v1/resources...https://sandbox.bluebrainnexus.io/v1/resources......NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
88https://sandbox.bluebrainnexus.io/v1/resources...Person[Nobel]Jane Doehttps://bluebrain.github.io/nexus/schemas/unco...2022-09-27T09:30:07.586Zhttps://sandbox.bluebrainnexus.io/v1/realms/gi...Falsehttps://sandbox.bluebrainnexus.io/v1/resources...https://sandbox.bluebrainnexus.io/v1/resources......NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
89https://sandbox.bluebrainnexus.io/v1/resources...Person[Nobel]Jane Doehttps://bluebrain.github.io/nexus/schemas/unco...2022-09-27T09:30:08.654Zhttps://sandbox.bluebrainnexus.io/v1/realms/gi...Falsehttps://sandbox.bluebrainnexus.io/v1/resources...https://sandbox.bluebrainnexus.io/v1/resources......NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
90https://sandbox.bluebrainnexus.io/v1/resources...Person[Nobel]Jane Doehttps://bluebrain.github.io/nexus/schemas/unco...2022-09-27T09:31:18.061Zhttps://sandbox.bluebrainnexus.io/v1/realms/gi...Falsehttps://sandbox.bluebrainnexus.io/v1/resources...https://sandbox.bluebrainnexus.io/v1/resources......NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
91https://sandbox.bluebrainnexus.io/v1/projects/...1https://sandbox.bluebrainnexus.io/v1/projects/...https://sandbox.bluebrainnexus.io/v1/resources...Person[Nobel]Jane Doehttps://bluebrain.github.io/nexus/schemas/unco...2022-09-27T09:31:19.909Z2023-05-22T08:58:03.175Zhttps://sandbox.bluebrainnexus.io/v1/realms/gi...Falsehttps://sandbox.bluebrainnexus.io/v1/resources...https://sandbox.bluebrainnexus.io/v1/resources......NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
\n", - "

92 rows × 32 columns

\n", + "

1 rows × 27 columns

\n", "
" ], "text/plain": [ - " id type award \\\n", - "0 https://sandbox.bluebrainnexus.io/v1/resources... Person [Nobel] \n", - "1 https://sandbox.bluebrainnexus.io/v1/resources... Person [Nobel] \n", - "2 https://sandbox.bluebrainnexus.io/v1/resources... Person [Nobel] \n", - "3 https://sandbox.bluebrainnexus.io/v1/resources... Person [Nobel] \n", - "4 https://sandbox.bluebrainnexus.io/v1/resources... Person [Nobel] \n", - ".. ... ... ... \n", - "87 https://sandbox.bluebrainnexus.io/v1/resources... Person [Nobel] \n", - "88 https://sandbox.bluebrainnexus.io/v1/resources... Person [Nobel] \n", - "89 https://sandbox.bluebrainnexus.io/v1/resources... Person [Nobel] \n", - "90 https://sandbox.bluebrainnexus.io/v1/resources... Person [Nobel] \n", - "91 https://sandbox.bluebrainnexus.io/v1/resources... Person [Nobel] \n", + " id type \\\n", + "0 https://sandbox.bluebrainnexus.io/v1/resources... Dataset \n", + "\n", + " contribution distribution.type \\\n", + "0 [{'type': 'Contribution', 'agent': {'type': 'P... DataDownload \n", "\n", - " name _constrainedBy \\\n", - "0 Jane Doe https://bluebrain.github.io/nexus/schemas/unco... \n", - "1 Jane Doe https://bluebrain.github.io/nexus/schemas/unco... \n", - "2 Jane Doe https://bluebrain.github.io/nexus/schemas/unco... \n", - "3 Jane Doe https://bluebrain.github.io/nexus/schemas/unco... \n", - "4 Jane Doe https://bluebrain.github.io/nexus/schemas/unco... \n", - ".. ... ... \n", - "87 Jane Doe https://bluebrain.github.io/nexus/schemas/unco... \n", - "88 Jane Doe https://bluebrain.github.io/nexus/schemas/unco... \n", - "89 Jane Doe https://bluebrain.github.io/nexus/schemas/unco... \n", - "90 Jane Doe https://bluebrain.github.io/nexus/schemas/unco... \n", - "91 Jane Doe https://bluebrain.github.io/nexus/schemas/unco... \n", + " distribution.atLocation.type \\\n", + "0 Location \n", + "\n", + " distribution.atLocation.store.id \\\n", + "0 https://bluebrain.github.io/nexus/vocabulary/d... \n", "\n", - " _createdAt \\\n", - "0 2023-01-25T13:18:06.856Z \n", - "1 2023-01-25T13:18:07.458Z \n", - "2 2023-01-25T13:24:17.096Z \n", - "3 2023-01-25T13:24:17.703Z \n", - "4 2023-01-25T13:31:49.101Z \n", - ".. ... \n", - "87 2022-09-27T08:55:43.621Z \n", - "88 2022-09-27T09:30:07.586Z \n", - "89 2022-09-27T09:30:08.654Z \n", - "90 2022-09-27T09:31:18.061Z \n", - "91 2022-09-27T09:31:19.909Z \n", + " distribution.atLocation.store.type distribution.atLocation.store._rev \\\n", + "0 DiskStorage 1 \n", "\n", - " _createdBy _deprecated \\\n", - "0 https://sandbox.bluebrainnexus.io/v1/realms/gi... False \n", - "1 https://sandbox.bluebrainnexus.io/v1/realms/gi... False \n", - "2 https://sandbox.bluebrainnexus.io/v1/realms/gi... False \n", - "3 https://sandbox.bluebrainnexus.io/v1/realms/gi... False \n", - "4 https://sandbox.bluebrainnexus.io/v1/realms/gi... False \n", - ".. ... ... \n", - "87 https://sandbox.bluebrainnexus.io/v1/realms/gi... False \n", - "88 https://sandbox.bluebrainnexus.io/v1/realms/gi... False \n", - "89 https://sandbox.bluebrainnexus.io/v1/realms/gi... False \n", - "90 https://sandbox.bluebrainnexus.io/v1/realms/gi... False \n", - "91 https://sandbox.bluebrainnexus.io/v1/realms/gi... False \n", + " distribution.contentSize.unitCode distribution.contentSize.value ... \\\n", + "0 bytes 477 ... \n", "\n", - " _incoming \\\n", - "0 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "1 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "2 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "3 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "4 https://sandbox.bluebrainnexus.io/v1/resources... \n", - ".. ... \n", - "87 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "88 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "89 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "90 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "91 https://sandbox.bluebrainnexus.io/v1/resources... \n", + " _createdBy _deprecated \\\n", + "0 https://sandbox.bluebrainnexus.io/v1/realms/gi... False \n", "\n", - " _outgoing ... \\\n", - "0 https://sandbox.bluebrainnexus.io/v1/resources... ... \n", - "1 https://sandbox.bluebrainnexus.io/v1/resources... ... \n", - "2 https://sandbox.bluebrainnexus.io/v1/resources... ... \n", - "3 https://sandbox.bluebrainnexus.io/v1/resources... ... \n", - "4 https://sandbox.bluebrainnexus.io/v1/resources... ... \n", - ".. ... ... \n", - "87 https://sandbox.bluebrainnexus.io/v1/resources... ... \n", - "88 https://sandbox.bluebrainnexus.io/v1/resources... ... \n", - "89 https://sandbox.bluebrainnexus.io/v1/resources... ... \n", - "90 https://sandbox.bluebrainnexus.io/v1/resources... ... \n", - "91 https://sandbox.bluebrainnexus.io/v1/resources... ... \n", + " _incoming \\\n", + "0 https://sandbox.bluebrainnexus.io/v1/resources... \n", "\n", - " distribution.atLocation.store.id distribution.atLocation.store.type \\\n", - "0 NaN NaN \n", - "1 NaN NaN \n", - "2 NaN NaN \n", - "3 NaN NaN \n", - "4 NaN NaN \n", - ".. ... ... \n", - "87 NaN NaN \n", - "88 NaN NaN \n", - "89 NaN NaN \n", - "90 NaN NaN \n", - "91 NaN NaN \n", + " _outgoing \\\n", + "0 https://sandbox.bluebrainnexus.io/v1/resources... \n", "\n", - " distribution.atLocation.store._rev distribution.contentSize.unitCode \\\n", - "0 NaN NaN \n", - "1 NaN NaN \n", - "2 NaN NaN \n", - "3 NaN NaN \n", - "4 NaN NaN \n", - ".. ... ... \n", - "87 NaN NaN \n", - "88 NaN NaN \n", - "89 NaN NaN \n", - "90 NaN NaN \n", - "91 NaN NaN \n", + " _project _rev \\\n", + "0 https://sandbox.bluebrainnexus.io/v1/projects/... 1 \n", "\n", - " distribution.contentSize.value distribution.contentUrl \\\n", - "0 NaN NaN \n", - "1 NaN NaN \n", - "2 NaN NaN \n", - "3 NaN NaN \n", - "4 NaN NaN \n", - ".. ... ... \n", - "87 NaN NaN \n", - "88 NaN NaN \n", - "89 NaN NaN \n", - "90 NaN NaN \n", - "91 NaN NaN \n", + " _schemaProject \\\n", + "0 https://sandbox.bluebrainnexus.io/v1/projects/... \n", "\n", - " distribution.digest.algorithm distribution.digest.value \\\n", - "0 NaN NaN \n", - "1 NaN NaN \n", - "2 NaN NaN \n", - "3 NaN NaN \n", - "4 NaN NaN \n", - ".. ... ... \n", - "87 NaN NaN \n", - "88 NaN NaN \n", - "89 NaN NaN \n", - "90 NaN NaN \n", - "91 NaN NaN \n", + " _self \\\n", + "0 https://sandbox.bluebrainnexus.io/v1/resources... \n", "\n", - " distribution.encodingFormat distribution.name \n", - "0 NaN NaN \n", - "1 NaN NaN \n", - "2 NaN NaN \n", - "3 NaN NaN \n", - "4 NaN NaN \n", - ".. ... ... \n", - "87 NaN NaN \n", - "88 NaN NaN \n", - "89 NaN NaN \n", - "90 NaN NaN \n", - "91 NaN NaN \n", + " _updatedAt _updatedBy \n", + "0 2023-05-22T08:58:03.175Z https://sandbox.bluebrainnexus.io/v1/realms/gi... \n", "\n", - "[92 rows x 32 columns]" + "[1 rows x 27 columns]" ] }, - "execution_count": 45, + "execution_count": 59, "metadata": {}, "output_type": "execute_result" } @@ -1701,63 +1721,94 @@ "forge.as_dataframe(resources, store_metadata=True)" ] }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Using built-in Filter objects" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Supported filter operators" + ] + }, { "cell_type": "code", - "execution_count": 46, + "execution_count": 60, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "False" + "['__eq__ (EQUAL)',\n", + " '__ne__ (NOT_EQUAL)',\n", + " '__lt__ (LOWER_THAN)',\n", + " '__le__ (LOWER_OR_Equal_Than)',\n", + " '__gt__ (GREATER_Than)',\n", + " '__ge__ (GREATER_OR_Equal_Than)']" ] }, - "execution_count": 46, + "execution_count": 60, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "# Search results are not synchronized\n", - "resources[0]._synchronized" + "[f\"{op.value} ({op.name})\" for op in FilterOperator] # These are equivalent to the Python comparison operators" ] }, { - "cell_type": "markdown", + "cell_type": "code", + "execution_count": 61, "metadata": {}, + "outputs": [], "source": [ - "#### Using nested resource property" + "# Search for resources of type Dataset and with text/tab-separated-values as distribution.encodingFormat\n", + "# and created a given dateTime (dateTime values should be signaled by the suffix \"^^xsd:dateTime\")\n", + "filter_1 = Filter(operator=FilterOperator.EQUAL, path=[\"type\"], value=\"Dataset\")\n", + "filter_2 = Filter(operator=FilterOperator.EQUAL, path=[\"distribution\",\"encodingFormat\"], value=\"text/tab-separated-values\")\n", + "filter_3 = Filter(operator=FilterOperator.LOWER_OR_Equal_Than, path=[\"_createdAt\"], value=dataset._store_metadata._createdAt+\"^^xsd:dateTime\")\n", + "\n", + "resources = forge.search(filter_1, filter_2, filter_3, limit=3)" ] }, { - "cell_type": "markdown", + "cell_type": "code", + "execution_count": 62, "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "list" + ] + }, + "execution_count": 62, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ - "Property autocompletion is available on a path `p` even for nested properties like `p.contribution`." - ] - }, - { - "cell_type": "code", - "execution_count": 47, - "metadata": {}, - "outputs": [], - "source": [ - "# Search for resources of type Dataset and with text/tab-separated-values as distribution.encodingFormat\n", - "resources = forge.search(p.type.id == \"Dataset\", p.distribution.encodingFormat == \"text/tab-separated-values\", limit=3)" + "type(resources)" ] }, { "cell_type": "code", - "execution_count": 48, + "execution_count": 63, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "22" + "3" ] }, - "execution_count": 48, + "execution_count": 63, "metadata": {}, "output_type": "execute_result" } @@ -1768,10 +1819,8 @@ }, { "cell_type": "code", - "execution_count": 49, - "metadata": { - "scrolled": true - }, + "execution_count": 64, + "metadata": {}, "outputs": [ { "data": { @@ -1796,6 +1845,7 @@ " \n", " id\n", " type\n", + " contribution\n", " distribution.type\n", " distribution.atLocation.type\n", " distribution.atLocation.store.id\n", @@ -1803,13 +1853,17 @@ " distribution.atLocation.store._rev\n", " distribution.contentSize.unitCode\n", " distribution.contentSize.value\n", - " distribution.contentUrl\n", - " distribution.digest.algorithm\n", - " distribution.digest.value\n", - " distribution.encodingFormat\n", - " distribution.name\n", - " name\n", - " contribution\n", + " ...\n", + " _createdBy\n", + " _deprecated\n", + " _incoming\n", + " _outgoing\n", + " _project\n", + " _rev\n", + " _schemaProject\n", + " _self\n", + " _updatedAt\n", + " _updatedBy\n", " \n", " \n", " \n", @@ -1817,6 +1871,7 @@ " 0\n", " https://sandbox.bluebrainnexus.io/v1/resources...\n", " Dataset\n", + " [{'type': 'Contribution', 'agent': {'type': 'P...\n", " DataDownload\n", " Location\n", " https://bluebrain.github.io/nexus/vocabulary/d...\n", @@ -1824,75 +1879,23 @@ " 1\n", " bytes\n", " 477\n", - " https://sandbox.bluebrainnexus.io/v1/files/git...\n", - " SHA-256\n", - " 789aa07948683fe036ac29811814a826b703b562f7d168...\n", - " text/tab-separated-values\n", - " associations.tsv\n", - " Interesting Persons\n", - " NaN\n", - " \n", - " \n", - " 1\n", + " ...\n", + " https://sandbox.bluebrainnexus.io/v1/realms/gi...\n", + " False\n", " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " Dataset\n", - " DataDownload\n", - " Location\n", - " https://bluebrain.github.io/nexus/vocabulary/d...\n", - " DiskStorage\n", - " 1\n", - " bytes\n", - " 477\n", - " https://sandbox.bluebrainnexus.io/v1/files/git...\n", - " SHA-256\n", - " 789aa07948683fe036ac29811814a826b703b562f7d168...\n", - " text/tab-separated-values\n", - " associations.tsv\n", - " NaN\n", - " [{'type': 'Contribution', 'agent': {'type': 'P...\n", - " \n", - " \n", - " 2\n", " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " Dataset\n", - " DataDownload\n", - " Location\n", - " https://bluebrain.github.io/nexus/vocabulary/d...\n", - " DiskStorage\n", + " https://sandbox.bluebrainnexus.io/v1/projects/...\n", " 1\n", - " bytes\n", - " 477\n", - " https://sandbox.bluebrainnexus.io/v1/files/git...\n", - " SHA-256\n", - " 789aa07948683fe036ac29811814a826b703b562f7d168...\n", - " text/tab-separated-values\n", - " associations.tsv\n", - " NaN\n", - " [{'type': 'Contribution', 'agent': {'type': 'P...\n", - " \n", - " \n", - " 3\n", + " https://sandbox.bluebrainnexus.io/v1/projects/...\n", " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " Dataset\n", - " DataDownload\n", - " Location\n", - " https://bluebrain.github.io/nexus/vocabulary/d...\n", - " DiskStorage\n", - " 1\n", - " bytes\n", - " 477\n", - " https://sandbox.bluebrainnexus.io/v1/files/git...\n", - " SHA-256\n", - " 789aa07948683fe036ac29811814a826b703b562f7d168...\n", - " text/tab-separated-values\n", - " associations.tsv\n", - " NaN\n", - " [{'type': 'Contribution', 'agent': {'type': 'P...\n", + " 2023-03-29T12:57:29.375Z\n", + " https://sandbox.bluebrainnexus.io/v1/realms/gi...\n", " \n", " \n", - " 4\n", + " 1\n", " https://sandbox.bluebrainnexus.io/v1/resources...\n", " Dataset\n", + " [{'type': 'Contribution', 'agent': {'type': 'P...\n", " DataDownload\n", " Location\n", " https://bluebrain.github.io/nexus/vocabulary/d...\n", @@ -1900,94 +1903,23 @@ " 1\n", " bytes\n", " 477\n", - " https://sandbox.bluebrainnexus.io/v1/files/git...\n", - " SHA-256\n", - " 789aa07948683fe036ac29811814a826b703b562f7d168...\n", - " text/tab-separated-values\n", - " associations.tsv\n", - " Interesting Persons\n", - " NaN\n", - " \n", - " \n", - " 5\n", + " ...\n", + " https://sandbox.bluebrainnexus.io/v1/realms/gi...\n", + " False\n", " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " Dataset\n", - " DataDownload\n", - " Location\n", - " https://bluebrain.github.io/nexus/vocabulary/d...\n", - " DiskStorage\n", - " 1\n", - " bytes\n", - " 477\n", - " https://sandbox.bluebrainnexus.io/v1/files/git...\n", - " SHA-256\n", - " 789aa07948683fe036ac29811814a826b703b562f7d168...\n", - " text/tab-separated-values\n", - " associations.tsv\n", - " NaN\n", - " [{'type': 'Contribution', 'agent': {'type': 'P...\n", - " \n", - " \n", - " 6\n", " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " Dataset\n", - " DataDownload\n", - " Location\n", - " https://bluebrain.github.io/nexus/vocabulary/d...\n", - " DiskStorage\n", + " https://sandbox.bluebrainnexus.io/v1/projects/...\n", " 1\n", - " bytes\n", - " 477\n", - " https://sandbox.bluebrainnexus.io/v1/files/git...\n", - " SHA-256\n", - " 789aa07948683fe036ac29811814a826b703b562f7d168...\n", - " text/tab-separated-values\n", - " associations.tsv\n", - " NaN\n", - " [{'type': 'Contribution', 'agent': {'type': 'P...\n", - " \n", - " \n", - " 7\n", + " https://sandbox.bluebrainnexus.io/v1/projects/...\n", " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " Dataset\n", - " DataDownload\n", - " Location\n", - " https://bluebrain.github.io/nexus/vocabulary/d...\n", - " DiskStorage\n", - " 1\n", - " bytes\n", - " 477\n", - " https://sandbox.bluebrainnexus.io/v1/files/git...\n", - " SHA-256\n", - " 789aa07948683fe036ac29811814a826b703b562f7d168...\n", - " text/tab-separated-values\n", - " associations.tsv\n", - " NaN\n", - " [{'type': 'Contribution', 'agent': {'type': 'P...\n", + " 2023-05-22T08:24:43.121Z\n", + " https://sandbox.bluebrainnexus.io/v1/realms/gi...\n", " \n", " \n", - " 8\n", + " 2\n", " https://sandbox.bluebrainnexus.io/v1/resources...\n", " Dataset\n", - " DataDownload\n", - " Location\n", - " https://bluebrain.github.io/nexus/vocabulary/d...\n", - " DiskStorage\n", - " 1\n", - " bytes\n", - " 477\n", - " https://sandbox.bluebrainnexus.io/v1/files/git...\n", - " SHA-256\n", - " 789aa07948683fe036ac29811814a826b703b562f7d168...\n", - " text/tab-separated-values\n", - " associations.tsv\n", - " NaN\n", " [{'type': 'Contribution', 'agent': {'type': 'P...\n", - " \n", - " \n", - " 9\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " Dataset\n", " DataDownload\n", " Location\n", " https://bluebrain.github.io/nexus/vocabulary/d...\n", @@ -1995,530 +1927,135 @@ " 1\n", " bytes\n", " 477\n", - " https://sandbox.bluebrainnexus.io/v1/files/git...\n", - " SHA-256\n", - " 789aa07948683fe036ac29811814a826b703b562f7d168...\n", - " text/tab-separated-values\n", - " associations.tsv\n", - " NaN\n", - " [{'type': 'Contribution', 'agent': {'type': 'P...\n", - " \n", - " \n", - " 10\n", + " ...\n", + " https://sandbox.bluebrainnexus.io/v1/realms/gi...\n", + " False\n", " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " Dataset\n", - " DataDownload\n", - " Location\n", - " https://bluebrain.github.io/nexus/vocabulary/d...\n", - " DiskStorage\n", - " 1\n", - " bytes\n", - " 477\n", - " https://sandbox.bluebrainnexus.io/v1/files/git...\n", - " SHA-256\n", - " 789aa07948683fe036ac29811814a826b703b562f7d168...\n", - " text/tab-separated-values\n", - " associations.tsv\n", - " NaN\n", - " [{'type': 'Contribution', 'agent': {'type': 'P...\n", - " \n", - " \n", - " 11\n", " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " Dataset\n", - " DataDownload\n", - " Location\n", - " https://bluebrain.github.io/nexus/vocabulary/d...\n", - " DiskStorage\n", + " https://sandbox.bluebrainnexus.io/v1/projects/...\n", " 1\n", - " bytes\n", - " 477\n", - " https://sandbox.bluebrainnexus.io/v1/files/git...\n", - " SHA-256\n", - " 789aa07948683fe036ac29811814a826b703b562f7d168...\n", - " text/tab-separated-values\n", - " associations.tsv\n", - " NaN\n", - " [{'type': 'Contribution', 'agent': {'type': 'P...\n", - " \n", - " \n", - " 12\n", + " https://sandbox.bluebrainnexus.io/v1/projects/...\n", " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " Dataset\n", - " DataDownload\n", - " Location\n", - " https://bluebrain.github.io/nexus/vocabulary/d...\n", - " DiskStorage\n", - " 1\n", - " bytes\n", - " 477\n", - " https://sandbox.bluebrainnexus.io/v1/files/git...\n", - " SHA-256\n", - " 789aa07948683fe036ac29811814a826b703b562f7d168...\n", - " text/tab-separated-values\n", - " associations.tsv\n", - " NaN\n", - " [{'type': 'Contribution', 'agent': {'type': 'P...\n", - " \n", - " \n", - " 13\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " Dataset\n", - " DataDownload\n", - " Location\n", - " https://bluebrain.github.io/nexus/vocabulary/d...\n", - " DiskStorage\n", - " 1\n", - " bytes\n", - " 477\n", - " https://sandbox.bluebrainnexus.io/v1/files/git...\n", - " SHA-256\n", - " 789aa07948683fe036ac29811814a826b703b562f7d168...\n", - " text/tab-separated-values\n", - " associations.tsv\n", - " NaN\n", - " [{'type': 'Contribution', 'agent': {'type': 'P...\n", - " \n", - " \n", - " 14\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " Dataset\n", - " DataDownload\n", - " Location\n", - " https://bluebrain.github.io/nexus/vocabulary/d...\n", - " DiskStorage\n", - " 1\n", - " bytes\n", - " 477\n", - " https://sandbox.bluebrainnexus.io/v1/files/git...\n", - " SHA-256\n", - " 789aa07948683fe036ac29811814a826b703b562f7d168...\n", - " text/tab-separated-values\n", - " associations.tsv\n", - " Interesting Persons\n", - " NaN\n", - " \n", - " \n", - " 15\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " Dataset\n", - " DataDownload\n", - " Location\n", - " https://bluebrain.github.io/nexus/vocabulary/d...\n", - " DiskStorage\n", - " 1\n", - " bytes\n", - " 477\n", - " https://sandbox.bluebrainnexus.io/v1/files/git...\n", - " SHA-256\n", - " 789aa07948683fe036ac29811814a826b703b562f7d168...\n", - " text/tab-separated-values\n", - " associations.tsv\n", - " Interesting Persons\n", - " NaN\n", - " \n", - " \n", - " 16\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " Dataset\n", - " DataDownload\n", - " Location\n", - " https://bluebrain.github.io/nexus/vocabulary/d...\n", - " DiskStorage\n", - " 1\n", - " bytes\n", - " 477\n", - " https://sandbox.bluebrainnexus.io/v1/files/git...\n", - " SHA-256\n", - " 789aa07948683fe036ac29811814a826b703b562f7d168...\n", - " text/tab-separated-values\n", - " associations.tsv\n", - " NaN\n", - " [{'type': 'Contribution', 'agent': {'type': 'P...\n", - " \n", - " \n", - " 17\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " Dataset\n", - " DataDownload\n", - " Location\n", - " https://bluebrain.github.io/nexus/vocabulary/d...\n", - " DiskStorage\n", - " 1\n", - " bytes\n", - " 477\n", - " https://sandbox.bluebrainnexus.io/v1/files/git...\n", - " SHA-256\n", - " 789aa07948683fe036ac29811814a826b703b562f7d168...\n", - " text/tab-separated-values\n", - " associations.tsv\n", - " NaN\n", - " [{'type': 'Contribution', 'agent': {'type': 'P...\n", - " \n", - " \n", - " 18\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " Dataset\n", - " DataDownload\n", - " Location\n", - " https://bluebrain.github.io/nexus/vocabulary/d...\n", - " DiskStorage\n", - " 1\n", - " bytes\n", - " 477\n", - " https://sandbox.bluebrainnexus.io/v1/files/git...\n", - " SHA-256\n", - " 789aa07948683fe036ac29811814a826b703b562f7d168...\n", - " text/tab-separated-values\n", - " associations.tsv\n", - " NaN\n", - " [{'type': 'Contribution', 'agent': {'type': 'P...\n", - " \n", - " \n", - " 19\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " Dataset\n", - " DataDownload\n", - " Location\n", - " https://bluebrain.github.io/nexus/vocabulary/d...\n", - " DiskStorage\n", - " 1\n", - " bytes\n", - " 477\n", - " https://sandbox.bluebrainnexus.io/v1/files/git...\n", - " SHA-256\n", - " 789aa07948683fe036ac29811814a826b703b562f7d168...\n", - " text/tab-separated-values\n", - " associations.tsv\n", - " NaN\n", - " [{'type': 'Contribution', 'agent': {'type': 'P...\n", - " \n", - " \n", - " 20\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " Dataset\n", - " DataDownload\n", - " Location\n", - " https://bluebrain.github.io/nexus/vocabulary/d...\n", - " DiskStorage\n", - " 1\n", - " bytes\n", - " 477\n", - " https://sandbox.bluebrainnexus.io/v1/files/git...\n", - " SHA-256\n", - " 789aa07948683fe036ac29811814a826b703b562f7d168...\n", - " text/tab-separated-values\n", - " associations.tsv\n", - " NaN\n", - " [{'type': 'Contribution', 'agent': {'type': 'P...\n", - " \n", - " \n", - " 21\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " Dataset\n", - " DataDownload\n", - " Location\n", - " https://bluebrain.github.io/nexus/vocabulary/d...\n", - " DiskStorage\n", - " 1\n", - " bytes\n", - " 477\n", - " https://sandbox.bluebrainnexus.io/v1/files/git...\n", - " SHA-256\n", - " 789aa07948683fe036ac29811814a826b703b562f7d168...\n", - " text/tab-separated-values\n", - " associations.tsv\n", - " NaN\n", - " [{'type': 'Contribution', 'agent': {'type': 'P...\n", + " 2023-05-22T08:58:03.175Z\n", + " https://sandbox.bluebrainnexus.io/v1/realms/gi...\n", " \n", " \n", "\n", + "

3 rows × 27 columns

\n", "" ], "text/plain": [ - " id type \\\n", - "0 https://sandbox.bluebrainnexus.io/v1/resources... Dataset \n", - "1 https://sandbox.bluebrainnexus.io/v1/resources... Dataset \n", - "2 https://sandbox.bluebrainnexus.io/v1/resources... Dataset \n", - "3 https://sandbox.bluebrainnexus.io/v1/resources... Dataset \n", - "4 https://sandbox.bluebrainnexus.io/v1/resources... Dataset \n", - "5 https://sandbox.bluebrainnexus.io/v1/resources... Dataset \n", - "6 https://sandbox.bluebrainnexus.io/v1/resources... Dataset \n", - "7 https://sandbox.bluebrainnexus.io/v1/resources... Dataset \n", - "8 https://sandbox.bluebrainnexus.io/v1/resources... Dataset \n", - "9 https://sandbox.bluebrainnexus.io/v1/resources... Dataset \n", - "10 https://sandbox.bluebrainnexus.io/v1/resources... Dataset \n", - "11 https://sandbox.bluebrainnexus.io/v1/resources... Dataset \n", - "12 https://sandbox.bluebrainnexus.io/v1/resources... Dataset \n", - "13 https://sandbox.bluebrainnexus.io/v1/resources... Dataset \n", - "14 https://sandbox.bluebrainnexus.io/v1/resources... Dataset \n", - "15 https://sandbox.bluebrainnexus.io/v1/resources... Dataset \n", - "16 https://sandbox.bluebrainnexus.io/v1/resources... Dataset \n", - "17 https://sandbox.bluebrainnexus.io/v1/resources... Dataset \n", - "18 https://sandbox.bluebrainnexus.io/v1/resources... Dataset \n", - "19 https://sandbox.bluebrainnexus.io/v1/resources... Dataset \n", - "20 https://sandbox.bluebrainnexus.io/v1/resources... Dataset \n", - "21 https://sandbox.bluebrainnexus.io/v1/resources... Dataset \n", + " id type \\\n", + "0 https://sandbox.bluebrainnexus.io/v1/resources... Dataset \n", + "1 https://sandbox.bluebrainnexus.io/v1/resources... Dataset \n", + "2 https://sandbox.bluebrainnexus.io/v1/resources... Dataset \n", + "\n", + " contribution distribution.type \\\n", + "0 [{'type': 'Contribution', 'agent': {'type': 'P... DataDownload \n", + "1 [{'type': 'Contribution', 'agent': {'type': 'P... DataDownload \n", + "2 [{'type': 'Contribution', 'agent': {'type': 'P... DataDownload \n", + "\n", + " distribution.atLocation.type \\\n", + "0 Location \n", + "1 Location \n", + "2 Location \n", + "\n", + " distribution.atLocation.store.id \\\n", + "0 https://bluebrain.github.io/nexus/vocabulary/d... \n", + "1 https://bluebrain.github.io/nexus/vocabulary/d... \n", + "2 https://bluebrain.github.io/nexus/vocabulary/d... \n", + "\n", + " distribution.atLocation.store.type distribution.atLocation.store._rev \\\n", + "0 DiskStorage 1 \n", + "1 DiskStorage 1 \n", + "2 DiskStorage 1 \n", "\n", - " distribution.type distribution.atLocation.type \\\n", - "0 DataDownload Location \n", - "1 DataDownload Location \n", - "2 DataDownload Location \n", - "3 DataDownload Location \n", - "4 DataDownload Location \n", - "5 DataDownload Location \n", - "6 DataDownload Location \n", - "7 DataDownload Location \n", - "8 DataDownload Location \n", - "9 DataDownload Location \n", - "10 DataDownload Location \n", - "11 DataDownload Location \n", - "12 DataDownload Location \n", - "13 DataDownload Location \n", - "14 DataDownload Location \n", - "15 DataDownload Location \n", - "16 DataDownload Location \n", - "17 DataDownload Location \n", - "18 DataDownload Location \n", - "19 DataDownload Location \n", - "20 DataDownload Location \n", - "21 DataDownload Location \n", + " distribution.contentSize.unitCode distribution.contentSize.value ... \\\n", + "0 bytes 477 ... \n", + "1 bytes 477 ... \n", + "2 bytes 477 ... \n", "\n", - " distribution.atLocation.store.id \\\n", - "0 https://bluebrain.github.io/nexus/vocabulary/d... \n", - "1 https://bluebrain.github.io/nexus/vocabulary/d... \n", - "2 https://bluebrain.github.io/nexus/vocabulary/d... \n", - "3 https://bluebrain.github.io/nexus/vocabulary/d... \n", - "4 https://bluebrain.github.io/nexus/vocabulary/d... \n", - "5 https://bluebrain.github.io/nexus/vocabulary/d... \n", - "6 https://bluebrain.github.io/nexus/vocabulary/d... \n", - "7 https://bluebrain.github.io/nexus/vocabulary/d... \n", - "8 https://bluebrain.github.io/nexus/vocabulary/d... \n", - "9 https://bluebrain.github.io/nexus/vocabulary/d... \n", - "10 https://bluebrain.github.io/nexus/vocabulary/d... \n", - "11 https://bluebrain.github.io/nexus/vocabulary/d... \n", - "12 https://bluebrain.github.io/nexus/vocabulary/d... \n", - "13 https://bluebrain.github.io/nexus/vocabulary/d... \n", - "14 https://bluebrain.github.io/nexus/vocabulary/d... \n", - "15 https://bluebrain.github.io/nexus/vocabulary/d... \n", - "16 https://bluebrain.github.io/nexus/vocabulary/d... \n", - "17 https://bluebrain.github.io/nexus/vocabulary/d... \n", - "18 https://bluebrain.github.io/nexus/vocabulary/d... \n", - "19 https://bluebrain.github.io/nexus/vocabulary/d... \n", - "20 https://bluebrain.github.io/nexus/vocabulary/d... \n", - "21 https://bluebrain.github.io/nexus/vocabulary/d... \n", + " _createdBy _deprecated \\\n", + "0 https://sandbox.bluebrainnexus.io/v1/realms/gi... False \n", + "1 https://sandbox.bluebrainnexus.io/v1/realms/gi... False \n", + "2 https://sandbox.bluebrainnexus.io/v1/realms/gi... False \n", "\n", - " distribution.atLocation.store.type distribution.atLocation.store._rev \\\n", - "0 DiskStorage 1 \n", - "1 DiskStorage 1 \n", - "2 DiskStorage 1 \n", - "3 DiskStorage 1 \n", - "4 DiskStorage 1 \n", - "5 DiskStorage 1 \n", - "6 DiskStorage 1 \n", - "7 DiskStorage 1 \n", - "8 DiskStorage 1 \n", - "9 DiskStorage 1 \n", - "10 DiskStorage 1 \n", - "11 DiskStorage 1 \n", - "12 DiskStorage 1 \n", - "13 DiskStorage 1 \n", - "14 DiskStorage 1 \n", - "15 DiskStorage 1 \n", - "16 DiskStorage 1 \n", - "17 DiskStorage 1 \n", - "18 DiskStorage 1 \n", - "19 DiskStorage 1 \n", - "20 DiskStorage 1 \n", - "21 DiskStorage 1 \n", + " _incoming \\\n", + "0 https://sandbox.bluebrainnexus.io/v1/resources... \n", + "1 https://sandbox.bluebrainnexus.io/v1/resources... \n", + "2 https://sandbox.bluebrainnexus.io/v1/resources... \n", "\n", - " distribution.contentSize.unitCode distribution.contentSize.value \\\n", - "0 bytes 477 \n", - "1 bytes 477 \n", - "2 bytes 477 \n", - "3 bytes 477 \n", - "4 bytes 477 \n", - "5 bytes 477 \n", - "6 bytes 477 \n", - "7 bytes 477 \n", - "8 bytes 477 \n", - "9 bytes 477 \n", - "10 bytes 477 \n", - "11 bytes 477 \n", - "12 bytes 477 \n", - "13 bytes 477 \n", - "14 bytes 477 \n", - "15 bytes 477 \n", - "16 bytes 477 \n", - "17 bytes 477 \n", - "18 bytes 477 \n", - "19 bytes 477 \n", - "20 bytes 477 \n", - "21 bytes 477 \n", + " _outgoing \\\n", + "0 https://sandbox.bluebrainnexus.io/v1/resources... \n", + "1 https://sandbox.bluebrainnexus.io/v1/resources... \n", + "2 https://sandbox.bluebrainnexus.io/v1/resources... \n", "\n", - " distribution.contentUrl \\\n", - "0 https://sandbox.bluebrainnexus.io/v1/files/git... \n", - "1 https://sandbox.bluebrainnexus.io/v1/files/git... \n", - "2 https://sandbox.bluebrainnexus.io/v1/files/git... \n", - "3 https://sandbox.bluebrainnexus.io/v1/files/git... \n", - "4 https://sandbox.bluebrainnexus.io/v1/files/git... \n", - "5 https://sandbox.bluebrainnexus.io/v1/files/git... \n", - "6 https://sandbox.bluebrainnexus.io/v1/files/git... \n", - "7 https://sandbox.bluebrainnexus.io/v1/files/git... \n", - "8 https://sandbox.bluebrainnexus.io/v1/files/git... \n", - "9 https://sandbox.bluebrainnexus.io/v1/files/git... \n", - "10 https://sandbox.bluebrainnexus.io/v1/files/git... \n", - "11 https://sandbox.bluebrainnexus.io/v1/files/git... \n", - "12 https://sandbox.bluebrainnexus.io/v1/files/git... \n", - "13 https://sandbox.bluebrainnexus.io/v1/files/git... \n", - "14 https://sandbox.bluebrainnexus.io/v1/files/git... \n", - "15 https://sandbox.bluebrainnexus.io/v1/files/git... \n", - "16 https://sandbox.bluebrainnexus.io/v1/files/git... \n", - "17 https://sandbox.bluebrainnexus.io/v1/files/git... \n", - "18 https://sandbox.bluebrainnexus.io/v1/files/git... \n", - "19 https://sandbox.bluebrainnexus.io/v1/files/git... \n", - "20 https://sandbox.bluebrainnexus.io/v1/files/git... \n", - "21 https://sandbox.bluebrainnexus.io/v1/files/git... \n", + " _project _rev \\\n", + "0 https://sandbox.bluebrainnexus.io/v1/projects/... 1 \n", + "1 https://sandbox.bluebrainnexus.io/v1/projects/... 1 \n", + "2 https://sandbox.bluebrainnexus.io/v1/projects/... 1 \n", "\n", - " distribution.digest.algorithm \\\n", - "0 SHA-256 \n", - "1 SHA-256 \n", - "2 SHA-256 \n", - "3 SHA-256 \n", - "4 SHA-256 \n", - "5 SHA-256 \n", - "6 SHA-256 \n", - "7 SHA-256 \n", - "8 SHA-256 \n", - "9 SHA-256 \n", - "10 SHA-256 \n", - "11 SHA-256 \n", - "12 SHA-256 \n", - "13 SHA-256 \n", - "14 SHA-256 \n", - "15 SHA-256 \n", - "16 SHA-256 \n", - "17 SHA-256 \n", - "18 SHA-256 \n", - "19 SHA-256 \n", - "20 SHA-256 \n", - "21 SHA-256 \n", + " _schemaProject \\\n", + "0 https://sandbox.bluebrainnexus.io/v1/projects/... \n", + "1 https://sandbox.bluebrainnexus.io/v1/projects/... \n", + "2 https://sandbox.bluebrainnexus.io/v1/projects/... \n", "\n", - " distribution.digest.value \\\n", - "0 789aa07948683fe036ac29811814a826b703b562f7d168... \n", - "1 789aa07948683fe036ac29811814a826b703b562f7d168... \n", - "2 789aa07948683fe036ac29811814a826b703b562f7d168... \n", - "3 789aa07948683fe036ac29811814a826b703b562f7d168... \n", - "4 789aa07948683fe036ac29811814a826b703b562f7d168... \n", - "5 789aa07948683fe036ac29811814a826b703b562f7d168... \n", - "6 789aa07948683fe036ac29811814a826b703b562f7d168... \n", - "7 789aa07948683fe036ac29811814a826b703b562f7d168... \n", - "8 789aa07948683fe036ac29811814a826b703b562f7d168... \n", - "9 789aa07948683fe036ac29811814a826b703b562f7d168... \n", - "10 789aa07948683fe036ac29811814a826b703b562f7d168... \n", - "11 789aa07948683fe036ac29811814a826b703b562f7d168... \n", - "12 789aa07948683fe036ac29811814a826b703b562f7d168... \n", - "13 789aa07948683fe036ac29811814a826b703b562f7d168... \n", - "14 789aa07948683fe036ac29811814a826b703b562f7d168... \n", - "15 789aa07948683fe036ac29811814a826b703b562f7d168... \n", - "16 789aa07948683fe036ac29811814a826b703b562f7d168... \n", - "17 789aa07948683fe036ac29811814a826b703b562f7d168... \n", - "18 789aa07948683fe036ac29811814a826b703b562f7d168... \n", - "19 789aa07948683fe036ac29811814a826b703b562f7d168... \n", - "20 789aa07948683fe036ac29811814a826b703b562f7d168... \n", - "21 789aa07948683fe036ac29811814a826b703b562f7d168... \n", + " _self \\\n", + "0 https://sandbox.bluebrainnexus.io/v1/resources... \n", + "1 https://sandbox.bluebrainnexus.io/v1/resources... \n", + "2 https://sandbox.bluebrainnexus.io/v1/resources... \n", "\n", - " distribution.encodingFormat distribution.name name \\\n", - "0 text/tab-separated-values associations.tsv Interesting Persons \n", - "1 text/tab-separated-values associations.tsv NaN \n", - "2 text/tab-separated-values associations.tsv NaN \n", - "3 text/tab-separated-values associations.tsv NaN \n", - "4 text/tab-separated-values associations.tsv Interesting Persons \n", - "5 text/tab-separated-values associations.tsv NaN \n", - "6 text/tab-separated-values associations.tsv NaN \n", - "7 text/tab-separated-values associations.tsv NaN \n", - "8 text/tab-separated-values associations.tsv NaN \n", - "9 text/tab-separated-values associations.tsv NaN \n", - "10 text/tab-separated-values associations.tsv NaN \n", - "11 text/tab-separated-values associations.tsv NaN \n", - "12 text/tab-separated-values associations.tsv NaN \n", - "13 text/tab-separated-values associations.tsv NaN \n", - "14 text/tab-separated-values associations.tsv Interesting Persons \n", - "15 text/tab-separated-values associations.tsv Interesting Persons \n", - "16 text/tab-separated-values associations.tsv NaN \n", - "17 text/tab-separated-values associations.tsv NaN \n", - "18 text/tab-separated-values associations.tsv NaN \n", - "19 text/tab-separated-values associations.tsv NaN \n", - "20 text/tab-separated-values associations.tsv NaN \n", - "21 text/tab-separated-values associations.tsv NaN \n", + " _updatedAt _updatedBy \n", + "0 2023-03-29T12:57:29.375Z https://sandbox.bluebrainnexus.io/v1/realms/gi... \n", + "1 2023-05-22T08:24:43.121Z https://sandbox.bluebrainnexus.io/v1/realms/gi... \n", + "2 2023-05-22T08:58:03.175Z https://sandbox.bluebrainnexus.io/v1/realms/gi... \n", "\n", - " contribution \n", - "0 NaN \n", - "1 [{'type': 'Contribution', 'agent': {'type': 'P... \n", - "2 [{'type': 'Contribution', 'agent': {'type': 'P... \n", - "3 [{'type': 'Contribution', 'agent': {'type': 'P... \n", - "4 NaN \n", - "5 [{'type': 'Contribution', 'agent': {'type': 'P... \n", - "6 [{'type': 'Contribution', 'agent': {'type': 'P... \n", - "7 [{'type': 'Contribution', 'agent': {'type': 'P... \n", - "8 [{'type': 'Contribution', 'agent': {'type': 'P... \n", - "9 [{'type': 'Contribution', 'agent': {'type': 'P... \n", - "10 [{'type': 'Contribution', 'agent': {'type': 'P... \n", - "11 [{'type': 'Contribution', 'agent': {'type': 'P... \n", - "12 [{'type': 'Contribution', 'agent': {'type': 'P... \n", - "13 [{'type': 'Contribution', 'agent': {'type': 'P... \n", - "14 NaN \n", - "15 NaN \n", - "16 [{'type': 'Contribution', 'agent': {'type': 'P... \n", - "17 [{'type': 'Contribution', 'agent': {'type': 'P... \n", - "18 [{'type': 'Contribution', 'agent': {'type': 'P... \n", - "19 [{'type': 'Contribution', 'agent': {'type': 'P... \n", - "20 [{'type': 'Contribution', 'agent': {'type': 'P... \n", - "21 [{'type': 'Contribution', 'agent': {'type': 'P... " + "[3 rows x 27 columns]" ] }, - "execution_count": 49, + "execution_count": 64, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "forge.as_dataframe(resources)" + "forge.as_dataframe(resources, store_metadata=True)" ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ - "### Using dictionaries as filters\n", - "A dictionary can be provided for filters:\n", - "* {'type': {'id':'Dataset'}} is equivalent to p.type.id==\"Dataset\"\n", - "* only the '==' operator is supported\n", - "* nested dict are supported\n", - "* it is not mandatory for the provided properties and values to be defined in the forge model. Results will be retrieved if there are corresponding data in the store.\n", + "### Using search endpoints\n", "\n", - "This feature is not supported when using the DemoStore\n" + "Two types of search endpoints are supported: 'sparql' (default) for graph queries and 'elastic' for document oriented queries. The types of available search endpoint can be configured (see [00-Initialization.ipynb](00%20-%20Initialization.ipynb) for an example of search endpoints config) or set when creating a KnowledgeGraphForge session using the 'searchendpoints' arguments.\n", + "\n", + "The search endpoint to hit when calling forge.search(...) is 'sparql' by default but can be specified using the 'search_endpoint' argument." + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### SPARQL Search Endpoint" ] }, { "cell_type": "code", - "execution_count": 50, + "execution_count": 65, "metadata": {}, "outputs": [], "source": [ - "# Search for resources of type Dataset and with text/tab-separated-values as distribution.encodingFormat\n", - "# and created a given dateTime (by default, dateTime values should be signaled by the suffix \"^^xsd:dateTime\")\n", - "filters = {\n", - " \"type\": \"Dataset\", \n", - " \"distribution\":{\"encodingFormat\":\"text/tab-separated-values\"},\n", - " \"_createdAt\":dataset._store_metadata._createdAt+\"^^xsd:dateTime\"\n", - " }\n", - "resources = forge.search(filters, limit=3)" + "# Search for resources of type Person\n", + "filters = {\"type\": \"Person\"}\n", + "resources = forge.search(filters, limit=3, search_endpoint='sparql')" ] }, { "cell_type": "code", - "execution_count": 51, + "execution_count": 66, "metadata": {}, "outputs": [ { @@ -2527,7 +2064,7 @@ "list" ] }, - "execution_count": 51, + "execution_count": 66, "metadata": {}, "output_type": "execute_result" } @@ -2538,16 +2075,16 @@ }, { "cell_type": "code", - "execution_count": 52, + "execution_count": 67, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "1" + "3" ] }, - "execution_count": 52, + "execution_count": 67, "metadata": {}, "output_type": "execute_result" } @@ -2558,7 +2095,7 @@ }, { "cell_type": "code", - "execution_count": 53, + "execution_count": 68, "metadata": {}, "outputs": [ { @@ -2584,101 +2121,180 @@ " \n", " id\n", " type\n", - " contribution\n", - " distribution.type\n", - " distribution.atLocation.type\n", - " distribution.atLocation.store.id\n", - " distribution.atLocation.store.type\n", - " distribution.atLocation.store._rev\n", - " distribution.contentSize.unitCode\n", - " distribution.contentSize.value\n", - " ...\n", - " _createdBy\n", - " _deprecated\n", + " name\n", + " _constrainedBy\n", + " _createdAt\n", + " _createdBy\n", + " _deprecated\n", " _incoming\n", " _outgoing\n", " _project\n", - " _rev\n", - " _schemaProject\n", - " _self\n", - " _updatedAt\n", - " _updatedBy\n", + " ...\n", + " distribution.atLocation.store.id\n", + " distribution.atLocation.store.type\n", + " distribution.atLocation.store._rev\n", + " distribution.contentSize.unitCode\n", + " distribution.contentSize.value\n", + " distribution.contentUrl\n", + " distribution.digest.algorithm\n", + " distribution.digest.value\n", + " distribution.encodingFormat\n", + " distribution.name\n", " \n", " \n", " \n", " \n", " 0\n", " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " Dataset\n", - " [{'type': 'Contribution', 'agent': {'type': 'P...\n", - " DataDownload\n", - " Location\n", - " https://bluebrain.github.io/nexus/vocabulary/d...\n", - " DiskStorage\n", - " 1\n", - " bytes\n", - " 477\n", - " ...\n", + " Person\n", + " Albert Einstein\n", + " https://bluebrain.github.io/nexus/schemas/unco...\n", + " 2022-07-20T15:30:01.482Z\n", " https://sandbox.bluebrainnexus.io/v1/realms/gi...\n", " False\n", " https://sandbox.bluebrainnexus.io/v1/resources...\n", " https://sandbox.bluebrainnexus.io/v1/resources...\n", " https://sandbox.bluebrainnexus.io/v1/projects/...\n", - " 1\n", + " ...\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " \n", + " \n", + " 1\n", + " https://sandbox.bluebrainnexus.io/v1/resources...\n", + " Person\n", + " Marie Curie\n", + " https://bluebrain.github.io/nexus/schemas/unco...\n", + " 2022-07-20T15:30:01.467Z\n", + " https://sandbox.bluebrainnexus.io/v1/realms/gi...\n", + " False\n", + " https://sandbox.bluebrainnexus.io/v1/resources...\n", + " https://sandbox.bluebrainnexus.io/v1/resources...\n", " https://sandbox.bluebrainnexus.io/v1/projects/...\n", + " ...\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " NaN\n", + " \n", + " \n", + " 2\n", " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " 2023-01-25T13:31:53.616Z\n", + " Person\n", + " Jane Doe\n", + " https://bluebrain.github.io/nexus/schemas/unco...\n", + " 2022-07-20T15:27:50.435Z\n", " https://sandbox.bluebrainnexus.io/v1/realms/gi...\n", + " False\n", + " https://sandbox.bluebrainnexus.io/v1/resources...\n", + " https://sandbox.bluebrainnexus.io/v1/resources...\n", + " https://sandbox.bluebrainnexus.io/v1/projects/...\n", + " ...\n", + " https://bluebrain.github.io/nexus/vocabulary/d...\n", + " DiskStorage\n", + " 1.0\n", + " bytes\n", + " 477.0\n", + " https://sandbox.bluebrainnexus.io/v1/files/git...\n", + " SHA-256\n", + " 789aa07948683fe036ac29811814a826b703b562f7d168...\n", + " text/tab-separated-values\n", + " associations.tsv\n", " \n", " \n", "\n", - "

1 rows × 27 columns

\n", + "

3 rows × 27 columns

\n", "" ], "text/plain": [ - " id type \\\n", - "0 https://sandbox.bluebrainnexus.io/v1/resources... Dataset \n", - "\n", - " contribution distribution.type \\\n", - "0 [{'type': 'Contribution', 'agent': {'type': 'P... DataDownload \n", - "\n", - " distribution.atLocation.type \\\n", - "0 Location \n", + " id type name \\\n", + "0 https://sandbox.bluebrainnexus.io/v1/resources... Person Albert Einstein \n", + "1 https://sandbox.bluebrainnexus.io/v1/resources... Person Marie Curie \n", + "2 https://sandbox.bluebrainnexus.io/v1/resources... Person Jane Doe \n", "\n", - " distribution.atLocation.store.id \\\n", - "0 https://bluebrain.github.io/nexus/vocabulary/d... \n", - "\n", - " distribution.atLocation.store.type distribution.atLocation.store._rev \\\n", - "0 DiskStorage 1 \n", + " _constrainedBy \\\n", + "0 https://bluebrain.github.io/nexus/schemas/unco... \n", + "1 https://bluebrain.github.io/nexus/schemas/unco... \n", + "2 https://bluebrain.github.io/nexus/schemas/unco... \n", "\n", - " distribution.contentSize.unitCode distribution.contentSize.value ... \\\n", - "0 bytes 477 ... \n", + " _createdAt \\\n", + "0 2022-07-20T15:30:01.482Z \n", + "1 2022-07-20T15:30:01.467Z \n", + "2 2022-07-20T15:27:50.435Z \n", "\n", - " _createdBy _deprecated \\\n", - "0 https://sandbox.bluebrainnexus.io/v1/realms/gi... False \n", + " _createdBy _deprecated \\\n", + "0 https://sandbox.bluebrainnexus.io/v1/realms/gi... False \n", + "1 https://sandbox.bluebrainnexus.io/v1/realms/gi... False \n", + "2 https://sandbox.bluebrainnexus.io/v1/realms/gi... False \n", "\n", " _incoming \\\n", "0 https://sandbox.bluebrainnexus.io/v1/resources... \n", + "1 https://sandbox.bluebrainnexus.io/v1/resources... \n", + "2 https://sandbox.bluebrainnexus.io/v1/resources... \n", "\n", " _outgoing \\\n", "0 https://sandbox.bluebrainnexus.io/v1/resources... \n", + "1 https://sandbox.bluebrainnexus.io/v1/resources... \n", + "2 https://sandbox.bluebrainnexus.io/v1/resources... \n", "\n", - " _project _rev \\\n", - "0 https://sandbox.bluebrainnexus.io/v1/projects/... 1 \n", + " _project ... \\\n", + "0 https://sandbox.bluebrainnexus.io/v1/projects/... ... \n", + "1 https://sandbox.bluebrainnexus.io/v1/projects/... ... \n", + "2 https://sandbox.bluebrainnexus.io/v1/projects/... ... \n", "\n", - " _schemaProject \\\n", - "0 https://sandbox.bluebrainnexus.io/v1/projects/... \n", + " distribution.atLocation.store.id \\\n", + "0 NaN \n", + "1 NaN \n", + "2 https://bluebrain.github.io/nexus/vocabulary/d... \n", "\n", - " _self \\\n", - "0 https://sandbox.bluebrainnexus.io/v1/resources... \n", + " distribution.atLocation.store.type distribution.atLocation.store._rev \\\n", + "0 NaN NaN \n", + "1 NaN NaN \n", + "2 DiskStorage 1.0 \n", "\n", - " _updatedAt _updatedBy \n", - "0 2023-01-25T13:31:53.616Z https://sandbox.bluebrainnexus.io/v1/realms/gi... \n", + " distribution.contentSize.unitCode distribution.contentSize.value \\\n", + "0 NaN NaN \n", + "1 NaN NaN \n", + "2 bytes 477.0 \n", "\n", - "[1 rows x 27 columns]" + " distribution.contentUrl \\\n", + "0 NaN \n", + "1 NaN \n", + "2 https://sandbox.bluebrainnexus.io/v1/files/git... \n", + "\n", + " distribution.digest.algorithm \\\n", + "0 NaN \n", + "1 NaN \n", + "2 SHA-256 \n", + "\n", + " distribution.digest.value \\\n", + "0 NaN \n", + "1 NaN \n", + "2 789aa07948683fe036ac29811814a826b703b562f7d168... \n", + "\n", + " distribution.encodingFormat distribution.name \n", + "0 NaN NaN \n", + "1 NaN NaN \n", + "2 text/tab-separated-values associations.tsv \n", + "\n", + "[3 rows x 27 columns]" ] }, - "execution_count": 53, + "execution_count": 68, "metadata": {}, "output_type": "execute_result" } @@ -2688,62 +2304,29 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ - "### Using built-in Filter objects" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "#### Supported filter operators" - ] - }, - { - "cell_type": "code", - "execution_count": 54, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "['__eq__ (EQUAL)',\n", - " '__ne__ (NOT_EQUAL)',\n", - " '__lt__ (LOWER_THAN)',\n", - " '__le__ (LOWER_OR_Equal_Than)',\n", - " '__gt__ (GREATER_Than)',\n", - " '__ge__ (GREATER_OR_Equal_Than)']" - ] - }, - "execution_count": 54, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "[f\"{op.value} ({op.name})\" for op in FilterOperator] # These are equivalent to the Python comparison operators" + "#### ElasticSearch Endpoint" ] }, { "cell_type": "code", - "execution_count": 55, + "execution_count": 69, "metadata": {}, "outputs": [], "source": [ - "# Search for resources of type Dataset and with text/tab-separated-values as distribution.encodingFormat\n", - "# and created a given dateTime (dateTime values should be signaled by the suffix \"^^xsd:dateTime\")\n", - "filter_1 = Filter(operator=FilterOperator.EQUAL, path=[\"type\"], value=\"Dataset\")\n", - "filter_2 = Filter(operator=FilterOperator.EQUAL, path=[\"distribution\",\"encodingFormat\"], value=\"text/tab-separated-values\")\n", - "filter_3 = Filter(operator=FilterOperator.LOWER_OR_Equal_Than, path=[\"_createdAt\"], value=dataset._store_metadata._createdAt+\"^^xsd:dateTime\")\n", - "\n", - "resources = forge.search(filter_1, filter_2, filter_3, limit=3)" + "# Search for resources of type Person and retrieve their ids and names.\n", + "filters = {\"@type\": \"http://schema.org/Person\"}\n", + "resources = forge.search(filters, limit=3, \n", + " search_endpoint='elastic', \n", + " includes=[\"@id\", \"@type\"]) # fields can also be excluded with 'excludes'" ] }, { "cell_type": "code", - "execution_count": 56, + "execution_count": 70, "metadata": {}, "outputs": [ { @@ -2752,7 +2335,7 @@ "list" ] }, - "execution_count": 56, + "execution_count": 70, "metadata": {}, "output_type": "execute_result" } @@ -2763,16 +2346,16 @@ }, { "cell_type": "code", - "execution_count": 57, + "execution_count": 71, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "22" + "3" ] }, - "execution_count": 57, + "execution_count": 71, "metadata": {}, "output_type": "execute_result" } @@ -2783,7 +2366,7 @@ }, { "cell_type": "code", - "execution_count": 58, + "execution_count": 72, "metadata": {}, "outputs": [ { @@ -2809,2946 +2392,126 @@ " \n", " id\n", " type\n", - " distribution.type\n", - " distribution.atLocation.type\n", - " distribution.atLocation.store.id\n", - " distribution.atLocation.store.type\n", - " distribution.atLocation.store._rev\n", - " distribution.contentSize.unitCode\n", - " distribution.contentSize.value\n", - " distribution.contentUrl\n", - " ...\n", - " _deprecated\n", - " _incoming\n", - " _outgoing\n", - " _project\n", - " _rev\n", - " _schemaProject\n", - " _self\n", - " _updatedAt\n", - " _updatedBy\n", - " contribution\n", " \n", " \n", " \n", " \n", " 0\n", " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " Dataset\n", - " DataDownload\n", - " Location\n", - " https://bluebrain.github.io/nexus/vocabulary/d...\n", - " DiskStorage\n", - " 1\n", - " bytes\n", - " 477\n", - " https://sandbox.bluebrainnexus.io/v1/files/git...\n", - " ...\n", - " False\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " https://sandbox.bluebrainnexus.io/v1/projects/...\n", - " 1\n", - " https://sandbox.bluebrainnexus.io/v1/projects/...\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " 2022-07-20T15:27:08.356Z\n", - " https://sandbox.bluebrainnexus.io/v1/realms/gi...\n", - " NaN\n", + " http://schema.org/Person\n", " \n", " \n", " 1\n", " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " Dataset\n", - " DataDownload\n", - " Location\n", - " https://bluebrain.github.io/nexus/vocabulary/d...\n", - " DiskStorage\n", - " 1\n", - " bytes\n", - " 477\n", - " https://sandbox.bluebrainnexus.io/v1/files/git...\n", - " ...\n", - " False\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " https://sandbox.bluebrainnexus.io/v1/projects/...\n", - " 1\n", - " https://sandbox.bluebrainnexus.io/v1/projects/...\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " 2022-07-20T16:53:40.970Z\n", - " https://sandbox.bluebrainnexus.io/v1/realms/gi...\n", - " [{'type': 'Contribution', 'agent': {'type': 'P...\n", + " http://schema.org/Person\n", " \n", " \n", " 2\n", " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " Dataset\n", - " DataDownload\n", - " Location\n", - " https://bluebrain.github.io/nexus/vocabulary/d...\n", - " DiskStorage\n", - " 1\n", - " bytes\n", - " 477\n", - " https://sandbox.bluebrainnexus.io/v1/files/git...\n", - " ...\n", - " False\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " https://sandbox.bluebrainnexus.io/v1/projects/...\n", - " 1\n", - " https://sandbox.bluebrainnexus.io/v1/projects/...\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " 2022-07-21T08:56:27.014Z\n", - " https://sandbox.bluebrainnexus.io/v1/realms/gi...\n", - " [{'type': 'Contribution', 'agent': {'type': 'P...\n", - " \n", - " \n", - " 3\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " Dataset\n", - " DataDownload\n", - " Location\n", - " https://bluebrain.github.io/nexus/vocabulary/d...\n", - " DiskStorage\n", - " 1\n", - " bytes\n", - " 477\n", - " https://sandbox.bluebrainnexus.io/v1/files/git...\n", - " ...\n", - " False\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " https://sandbox.bluebrainnexus.io/v1/projects/...\n", - " 1\n", - " https://sandbox.bluebrainnexus.io/v1/projects/...\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " 2022-07-27T09:12:56.220Z\n", - " https://sandbox.bluebrainnexus.io/v1/realms/gi...\n", - " [{'type': 'Contribution', 'agent': {'type': 'P...\n", - " \n", - " \n", - " 4\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " Dataset\n", - " DataDownload\n", - " Location\n", - " https://bluebrain.github.io/nexus/vocabulary/d...\n", - " DiskStorage\n", - " 1\n", - " bytes\n", - " 477\n", - " https://sandbox.bluebrainnexus.io/v1/files/git...\n", - " ...\n", - " False\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " https://sandbox.bluebrainnexus.io/v1/projects/...\n", - " 1\n", - " https://sandbox.bluebrainnexus.io/v1/projects/...\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " 2022-09-27T08:52:13.792Z\n", - " https://sandbox.bluebrainnexus.io/v1/realms/gi...\n", - " NaN\n", - " \n", - " \n", - " 5\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " Dataset\n", - " DataDownload\n", - " Location\n", - " https://bluebrain.github.io/nexus/vocabulary/d...\n", - " DiskStorage\n", - " 1\n", - " bytes\n", - " 477\n", - " https://sandbox.bluebrainnexus.io/v1/files/git...\n", - " ...\n", - " False\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " https://sandbox.bluebrainnexus.io/v1/projects/...\n", - " 1\n", - " https://sandbox.bluebrainnexus.io/v1/projects/...\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " 2022-09-27T08:55:46.766Z\n", - " https://sandbox.bluebrainnexus.io/v1/realms/gi...\n", - " [{'type': 'Contribution', 'agent': {'type': 'P...\n", - " \n", - " \n", - " 6\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " Dataset\n", - " DataDownload\n", - " Location\n", - " https://bluebrain.github.io/nexus/vocabulary/d...\n", - " DiskStorage\n", - " 1\n", - " bytes\n", - " 477\n", - " https://sandbox.bluebrainnexus.io/v1/files/git...\n", - " ...\n", - " False\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " https://sandbox.bluebrainnexus.io/v1/projects/...\n", - " 1\n", - " https://sandbox.bluebrainnexus.io/v1/projects/...\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " 2022-09-27T09:30:13.621Z\n", - " https://sandbox.bluebrainnexus.io/v1/realms/gi...\n", - " [{'type': 'Contribution', 'agent': {'type': 'P...\n", - " \n", - " \n", - " 7\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " Dataset\n", - " DataDownload\n", - " Location\n", - " https://bluebrain.github.io/nexus/vocabulary/d...\n", - " DiskStorage\n", - " 1\n", - " bytes\n", - " 477\n", - " https://sandbox.bluebrainnexus.io/v1/files/git...\n", - " ...\n", - " False\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " https://sandbox.bluebrainnexus.io/v1/projects/...\n", - " 1\n", - " https://sandbox.bluebrainnexus.io/v1/projects/...\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " 2022-09-27T09:31:31.740Z\n", - " https://sandbox.bluebrainnexus.io/v1/realms/gi...\n", - " [{'type': 'Contribution', 'agent': {'type': 'P...\n", - " \n", - " \n", - " 8\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " Dataset\n", - " DataDownload\n", - " Location\n", - " https://bluebrain.github.io/nexus/vocabulary/d...\n", - " DiskStorage\n", - " 1\n", - " bytes\n", - " 477\n", - " https://sandbox.bluebrainnexus.io/v1/files/git...\n", - " ...\n", - " False\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " https://sandbox.bluebrainnexus.io/v1/projects/...\n", - " 1\n", - " https://sandbox.bluebrainnexus.io/v1/projects/...\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " 2022-09-27T09:33:30.234Z\n", - " https://sandbox.bluebrainnexus.io/v1/realms/gi...\n", - " [{'type': 'Contribution', 'agent': {'type': 'P...\n", - " \n", - " \n", - " 9\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " Dataset\n", - " DataDownload\n", - " Location\n", - " https://bluebrain.github.io/nexus/vocabulary/d...\n", - " DiskStorage\n", - " 1\n", - " bytes\n", - " 477\n", - " https://sandbox.bluebrainnexus.io/v1/files/git...\n", - " ...\n", - " False\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " https://sandbox.bluebrainnexus.io/v1/projects/...\n", - " 1\n", - " https://sandbox.bluebrainnexus.io/v1/projects/...\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " 2022-09-28T14:07:28.848Z\n", - " https://sandbox.bluebrainnexus.io/v1/realms/gi...\n", - " [{'type': 'Contribution', 'agent': {'type': 'P...\n", - " \n", - " \n", - " 10\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " Dataset\n", - " DataDownload\n", - " Location\n", - " https://bluebrain.github.io/nexus/vocabulary/d...\n", - " DiskStorage\n", - " 1\n", - " bytes\n", - " 477\n", - " https://sandbox.bluebrainnexus.io/v1/files/git...\n", - " ...\n", - " False\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " https://sandbox.bluebrainnexus.io/v1/projects/...\n", - " 1\n", - " https://sandbox.bluebrainnexus.io/v1/projects/...\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " 2022-09-28T14:18:23.150Z\n", - " https://sandbox.bluebrainnexus.io/v1/realms/gi...\n", - " [{'type': 'Contribution', 'agent': {'type': 'P...\n", - " \n", - " \n", - " 11\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " Dataset\n", - " DataDownload\n", - " Location\n", - " https://bluebrain.github.io/nexus/vocabulary/d...\n", - " DiskStorage\n", - " 1\n", - " bytes\n", - " 477\n", - " https://sandbox.bluebrainnexus.io/v1/files/git...\n", - " ...\n", - " False\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " https://sandbox.bluebrainnexus.io/v1/projects/...\n", - " 1\n", - " https://sandbox.bluebrainnexus.io/v1/projects/...\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " 2022-09-28T14:20:45.788Z\n", - " https://sandbox.bluebrainnexus.io/v1/realms/gi...\n", - " [{'type': 'Contribution', 'agent': {'type': 'P...\n", - " \n", - " \n", - " 12\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " Dataset\n", - " DataDownload\n", - " Location\n", - " https://bluebrain.github.io/nexus/vocabulary/d...\n", - " DiskStorage\n", - " 1\n", - " bytes\n", - " 477\n", - " https://sandbox.bluebrainnexus.io/v1/files/git...\n", - " ...\n", - " False\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " https://sandbox.bluebrainnexus.io/v1/projects/...\n", - " 1\n", - " https://sandbox.bluebrainnexus.io/v1/projects/...\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " 2022-09-28T14:36:36.556Z\n", - " https://sandbox.bluebrainnexus.io/v1/realms/gi...\n", - " [{'type': 'Contribution', 'agent': {'type': 'P...\n", - " \n", - " \n", - " 13\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " Dataset\n", - " DataDownload\n", - " Location\n", - " https://bluebrain.github.io/nexus/vocabulary/d...\n", - " DiskStorage\n", - " 1\n", - " bytes\n", - " 477\n", - " https://sandbox.bluebrainnexus.io/v1/files/git...\n", - " ...\n", - " False\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " https://sandbox.bluebrainnexus.io/v1/projects/...\n", - " 1\n", - " https://sandbox.bluebrainnexus.io/v1/projects/...\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " 2022-09-28T14:38:13.837Z\n", - " https://sandbox.bluebrainnexus.io/v1/realms/gi...\n", - " [{'type': 'Contribution', 'agent': {'type': 'P...\n", - " \n", - " \n", - " 14\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " Dataset\n", - " DataDownload\n", - " Location\n", - " https://bluebrain.github.io/nexus/vocabulary/d...\n", - " DiskStorage\n", - " 1\n", - " bytes\n", - " 477\n", - " https://sandbox.bluebrainnexus.io/v1/files/git...\n", - " ...\n", - " False\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " https://sandbox.bluebrainnexus.io/v1/projects/...\n", - " 1\n", - " https://sandbox.bluebrainnexus.io/v1/projects/...\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " 2022-11-01T09:35:15.260Z\n", - " https://sandbox.bluebrainnexus.io/v1/realms/gi...\n", - " NaN\n", - " \n", - " \n", - " 15\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " Dataset\n", - " DataDownload\n", - " Location\n", - " https://bluebrain.github.io/nexus/vocabulary/d...\n", - " DiskStorage\n", - " 1\n", - " bytes\n", - " 477\n", - " https://sandbox.bluebrainnexus.io/v1/files/git...\n", - " ...\n", - " False\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " https://sandbox.bluebrainnexus.io/v1/projects/...\n", - " 1\n", - " https://sandbox.bluebrainnexus.io/v1/projects/...\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " 2022-12-07T08:27:08.594Z\n", - " https://sandbox.bluebrainnexus.io/v1/realms/gi...\n", - " NaN\n", - " \n", - " \n", - " 16\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " Dataset\n", - " DataDownload\n", - " Location\n", - " https://bluebrain.github.io/nexus/vocabulary/d...\n", - " DiskStorage\n", - " 1\n", - " bytes\n", - " 477\n", - " https://sandbox.bluebrainnexus.io/v1/files/git...\n", - " ...\n", - " False\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " https://sandbox.bluebrainnexus.io/v1/projects/...\n", - " 1\n", - " https://sandbox.bluebrainnexus.io/v1/projects/...\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " 2023-01-17T16:03:46.756Z\n", - " https://sandbox.bluebrainnexus.io/v1/realms/gi...\n", - " [{'type': 'Contribution', 'agent': {'type': 'P...\n", - " \n", - " \n", - " 17\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " Dataset\n", - " DataDownload\n", - " Location\n", - " https://bluebrain.github.io/nexus/vocabulary/d...\n", - " DiskStorage\n", - " 1\n", - " bytes\n", - " 477\n", - " https://sandbox.bluebrainnexus.io/v1/files/git...\n", - " ...\n", - " False\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " https://sandbox.bluebrainnexus.io/v1/projects/...\n", - " 1\n", - " https://sandbox.bluebrainnexus.io/v1/projects/...\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " 2023-01-18T12:16:51.522Z\n", - " https://sandbox.bluebrainnexus.io/v1/realms/gi...\n", - " [{'type': 'Contribution', 'agent': {'type': 'P...\n", - " \n", - " \n", - " 18\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " Dataset\n", - " DataDownload\n", - " Location\n", - " https://bluebrain.github.io/nexus/vocabulary/d...\n", - " DiskStorage\n", - " 1\n", - " bytes\n", - " 477\n", - " https://sandbox.bluebrainnexus.io/v1/files/git...\n", - " ...\n", - " False\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " https://sandbox.bluebrainnexus.io/v1/projects/...\n", - " 1\n", - " https://sandbox.bluebrainnexus.io/v1/projects/...\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " 2023-01-23T13:38:33.743Z\n", - " https://sandbox.bluebrainnexus.io/v1/realms/gi...\n", - " [{'type': 'Contribution', 'agent': {'type': 'P...\n", - " \n", - " \n", - " 19\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " Dataset\n", - " DataDownload\n", - " Location\n", - " https://bluebrain.github.io/nexus/vocabulary/d...\n", - " DiskStorage\n", - " 1\n", - " bytes\n", - " 477\n", - " https://sandbox.bluebrainnexus.io/v1/files/git...\n", - " ...\n", - " False\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " https://sandbox.bluebrainnexus.io/v1/projects/...\n", - " 1\n", - " https://sandbox.bluebrainnexus.io/v1/projects/...\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " 2023-01-25T13:18:11.559Z\n", - " https://sandbox.bluebrainnexus.io/v1/realms/gi...\n", - " [{'type': 'Contribution', 'agent': {'type': 'P...\n", - " \n", - " \n", - " 20\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " Dataset\n", - " DataDownload\n", - " Location\n", - " https://bluebrain.github.io/nexus/vocabulary/d...\n", - " DiskStorage\n", - " 1\n", - " bytes\n", - " 477\n", - " https://sandbox.bluebrainnexus.io/v1/files/git...\n", - " ...\n", - " False\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " https://sandbox.bluebrainnexus.io/v1/projects/...\n", - " 1\n", - " https://sandbox.bluebrainnexus.io/v1/projects/...\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " 2023-01-25T13:24:22.173Z\n", - " https://sandbox.bluebrainnexus.io/v1/realms/gi...\n", - " [{'type': 'Contribution', 'agent': {'type': 'P...\n", - " \n", - " \n", - " 21\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " Dataset\n", - " DataDownload\n", - " Location\n", - " https://bluebrain.github.io/nexus/vocabulary/d...\n", - " DiskStorage\n", - " 1\n", - " bytes\n", - " 477\n", - " https://sandbox.bluebrainnexus.io/v1/files/git...\n", - " ...\n", - " False\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " https://sandbox.bluebrainnexus.io/v1/projects/...\n", - " 1\n", - " https://sandbox.bluebrainnexus.io/v1/projects/...\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " 2023-01-25T13:31:53.616Z\n", - " https://sandbox.bluebrainnexus.io/v1/realms/gi...\n", - " [{'type': 'Contribution', 'agent': {'type': 'P...\n", - " \n", - " \n", - "\n", - "

22 rows × 28 columns

\n", - "" - ], - "text/plain": [ - " id type \\\n", - "0 https://sandbox.bluebrainnexus.io/v1/resources... Dataset \n", - "1 https://sandbox.bluebrainnexus.io/v1/resources... Dataset \n", - "2 https://sandbox.bluebrainnexus.io/v1/resources... Dataset \n", - "3 https://sandbox.bluebrainnexus.io/v1/resources... Dataset \n", - "4 https://sandbox.bluebrainnexus.io/v1/resources... Dataset \n", - "5 https://sandbox.bluebrainnexus.io/v1/resources... Dataset \n", - "6 https://sandbox.bluebrainnexus.io/v1/resources... Dataset \n", - "7 https://sandbox.bluebrainnexus.io/v1/resources... Dataset \n", - "8 https://sandbox.bluebrainnexus.io/v1/resources... Dataset \n", - "9 https://sandbox.bluebrainnexus.io/v1/resources... Dataset \n", - "10 https://sandbox.bluebrainnexus.io/v1/resources... Dataset \n", - "11 https://sandbox.bluebrainnexus.io/v1/resources... Dataset \n", - "12 https://sandbox.bluebrainnexus.io/v1/resources... Dataset \n", - "13 https://sandbox.bluebrainnexus.io/v1/resources... Dataset \n", - "14 https://sandbox.bluebrainnexus.io/v1/resources... Dataset \n", - "15 https://sandbox.bluebrainnexus.io/v1/resources... Dataset \n", - "16 https://sandbox.bluebrainnexus.io/v1/resources... Dataset \n", - "17 https://sandbox.bluebrainnexus.io/v1/resources... Dataset \n", - "18 https://sandbox.bluebrainnexus.io/v1/resources... Dataset \n", - "19 https://sandbox.bluebrainnexus.io/v1/resources... Dataset \n", - "20 https://sandbox.bluebrainnexus.io/v1/resources... Dataset \n", - "21 https://sandbox.bluebrainnexus.io/v1/resources... Dataset \n", - "\n", - " distribution.type distribution.atLocation.type \\\n", - "0 DataDownload Location \n", - "1 DataDownload Location \n", - "2 DataDownload Location \n", - "3 DataDownload Location \n", - "4 DataDownload Location \n", - "5 DataDownload Location \n", - "6 DataDownload Location \n", - "7 DataDownload Location \n", - "8 DataDownload Location \n", - "9 DataDownload Location \n", - "10 DataDownload Location \n", - "11 DataDownload Location \n", - "12 DataDownload Location \n", - "13 DataDownload Location \n", - "14 DataDownload Location \n", - "15 DataDownload Location \n", - "16 DataDownload Location \n", - "17 DataDownload Location \n", - "18 DataDownload Location \n", - "19 DataDownload Location \n", - "20 DataDownload Location \n", - "21 DataDownload Location \n", - "\n", - " distribution.atLocation.store.id \\\n", - "0 https://bluebrain.github.io/nexus/vocabulary/d... \n", - "1 https://bluebrain.github.io/nexus/vocabulary/d... \n", - "2 https://bluebrain.github.io/nexus/vocabulary/d... \n", - "3 https://bluebrain.github.io/nexus/vocabulary/d... \n", - "4 https://bluebrain.github.io/nexus/vocabulary/d... \n", - "5 https://bluebrain.github.io/nexus/vocabulary/d... \n", - "6 https://bluebrain.github.io/nexus/vocabulary/d... \n", - "7 https://bluebrain.github.io/nexus/vocabulary/d... \n", - "8 https://bluebrain.github.io/nexus/vocabulary/d... \n", - "9 https://bluebrain.github.io/nexus/vocabulary/d... \n", - "10 https://bluebrain.github.io/nexus/vocabulary/d... \n", - "11 https://bluebrain.github.io/nexus/vocabulary/d... \n", - "12 https://bluebrain.github.io/nexus/vocabulary/d... \n", - "13 https://bluebrain.github.io/nexus/vocabulary/d... \n", - "14 https://bluebrain.github.io/nexus/vocabulary/d... \n", - "15 https://bluebrain.github.io/nexus/vocabulary/d... \n", - "16 https://bluebrain.github.io/nexus/vocabulary/d... \n", - "17 https://bluebrain.github.io/nexus/vocabulary/d... \n", - "18 https://bluebrain.github.io/nexus/vocabulary/d... \n", - "19 https://bluebrain.github.io/nexus/vocabulary/d... \n", - "20 https://bluebrain.github.io/nexus/vocabulary/d... \n", - "21 https://bluebrain.github.io/nexus/vocabulary/d... \n", - "\n", - " distribution.atLocation.store.type distribution.atLocation.store._rev \\\n", - "0 DiskStorage 1 \n", - "1 DiskStorage 1 \n", - "2 DiskStorage 1 \n", - "3 DiskStorage 1 \n", - "4 DiskStorage 1 \n", - "5 DiskStorage 1 \n", - "6 DiskStorage 1 \n", - "7 DiskStorage 1 \n", - "8 DiskStorage 1 \n", - "9 DiskStorage 1 \n", - "10 DiskStorage 1 \n", - "11 DiskStorage 1 \n", - "12 DiskStorage 1 \n", - "13 DiskStorage 1 \n", - "14 DiskStorage 1 \n", - "15 DiskStorage 1 \n", - "16 DiskStorage 1 \n", - "17 DiskStorage 1 \n", - "18 DiskStorage 1 \n", - "19 DiskStorage 1 \n", - "20 DiskStorage 1 \n", - "21 DiskStorage 1 \n", - "\n", - " distribution.contentSize.unitCode distribution.contentSize.value \\\n", - "0 bytes 477 \n", - "1 bytes 477 \n", - "2 bytes 477 \n", - "3 bytes 477 \n", - "4 bytes 477 \n", - "5 bytes 477 \n", - "6 bytes 477 \n", - "7 bytes 477 \n", - "8 bytes 477 \n", - "9 bytes 477 \n", - "10 bytes 477 \n", - "11 bytes 477 \n", - "12 bytes 477 \n", - "13 bytes 477 \n", - "14 bytes 477 \n", - "15 bytes 477 \n", - "16 bytes 477 \n", - "17 bytes 477 \n", - "18 bytes 477 \n", - "19 bytes 477 \n", - "20 bytes 477 \n", - "21 bytes 477 \n", - "\n", - " distribution.contentUrl ... _deprecated \\\n", - "0 https://sandbox.bluebrainnexus.io/v1/files/git... ... False \n", - "1 https://sandbox.bluebrainnexus.io/v1/files/git... ... False \n", - "2 https://sandbox.bluebrainnexus.io/v1/files/git... ... False \n", - "3 https://sandbox.bluebrainnexus.io/v1/files/git... ... False \n", - "4 https://sandbox.bluebrainnexus.io/v1/files/git... ... False \n", - "5 https://sandbox.bluebrainnexus.io/v1/files/git... ... False \n", - "6 https://sandbox.bluebrainnexus.io/v1/files/git... ... False \n", - "7 https://sandbox.bluebrainnexus.io/v1/files/git... ... False \n", - "8 https://sandbox.bluebrainnexus.io/v1/files/git... ... False \n", - "9 https://sandbox.bluebrainnexus.io/v1/files/git... ... False \n", - "10 https://sandbox.bluebrainnexus.io/v1/files/git... ... False \n", - "11 https://sandbox.bluebrainnexus.io/v1/files/git... ... False \n", - "12 https://sandbox.bluebrainnexus.io/v1/files/git... ... False \n", - "13 https://sandbox.bluebrainnexus.io/v1/files/git... ... False \n", - "14 https://sandbox.bluebrainnexus.io/v1/files/git... ... False \n", - "15 https://sandbox.bluebrainnexus.io/v1/files/git... ... False \n", - "16 https://sandbox.bluebrainnexus.io/v1/files/git... ... False \n", - "17 https://sandbox.bluebrainnexus.io/v1/files/git... ... False \n", - "18 https://sandbox.bluebrainnexus.io/v1/files/git... ... False \n", - "19 https://sandbox.bluebrainnexus.io/v1/files/git... ... False \n", - "20 https://sandbox.bluebrainnexus.io/v1/files/git... ... False \n", - "21 https://sandbox.bluebrainnexus.io/v1/files/git... ... False \n", - "\n", - " _incoming \\\n", - "0 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "1 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "2 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "3 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "4 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "5 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "6 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "7 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "8 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "9 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "10 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "11 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "12 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "13 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "14 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "15 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "16 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "17 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "18 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "19 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "20 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "21 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "\n", - " _outgoing \\\n", - "0 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "1 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "2 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "3 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "4 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "5 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "6 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "7 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "8 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "9 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "10 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "11 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "12 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "13 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "14 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "15 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "16 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "17 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "18 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "19 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "20 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "21 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "\n", - " _project _rev \\\n", - "0 https://sandbox.bluebrainnexus.io/v1/projects/... 1 \n", - "1 https://sandbox.bluebrainnexus.io/v1/projects/... 1 \n", - "2 https://sandbox.bluebrainnexus.io/v1/projects/... 1 \n", - "3 https://sandbox.bluebrainnexus.io/v1/projects/... 1 \n", - "4 https://sandbox.bluebrainnexus.io/v1/projects/... 1 \n", - "5 https://sandbox.bluebrainnexus.io/v1/projects/... 1 \n", - "6 https://sandbox.bluebrainnexus.io/v1/projects/... 1 \n", - "7 https://sandbox.bluebrainnexus.io/v1/projects/... 1 \n", - "8 https://sandbox.bluebrainnexus.io/v1/projects/... 1 \n", - "9 https://sandbox.bluebrainnexus.io/v1/projects/... 1 \n", - "10 https://sandbox.bluebrainnexus.io/v1/projects/... 1 \n", - "11 https://sandbox.bluebrainnexus.io/v1/projects/... 1 \n", - "12 https://sandbox.bluebrainnexus.io/v1/projects/... 1 \n", - "13 https://sandbox.bluebrainnexus.io/v1/projects/... 1 \n", - "14 https://sandbox.bluebrainnexus.io/v1/projects/... 1 \n", - "15 https://sandbox.bluebrainnexus.io/v1/projects/... 1 \n", - "16 https://sandbox.bluebrainnexus.io/v1/projects/... 1 \n", - "17 https://sandbox.bluebrainnexus.io/v1/projects/... 1 \n", - "18 https://sandbox.bluebrainnexus.io/v1/projects/... 1 \n", - "19 https://sandbox.bluebrainnexus.io/v1/projects/... 1 \n", - "20 https://sandbox.bluebrainnexus.io/v1/projects/... 1 \n", - "21 https://sandbox.bluebrainnexus.io/v1/projects/... 1 \n", - "\n", - " _schemaProject \\\n", - "0 https://sandbox.bluebrainnexus.io/v1/projects/... \n", - "1 https://sandbox.bluebrainnexus.io/v1/projects/... \n", - "2 https://sandbox.bluebrainnexus.io/v1/projects/... \n", - "3 https://sandbox.bluebrainnexus.io/v1/projects/... \n", - "4 https://sandbox.bluebrainnexus.io/v1/projects/... \n", - "5 https://sandbox.bluebrainnexus.io/v1/projects/... \n", - "6 https://sandbox.bluebrainnexus.io/v1/projects/... \n", - "7 https://sandbox.bluebrainnexus.io/v1/projects/... \n", - "8 https://sandbox.bluebrainnexus.io/v1/projects/... \n", - "9 https://sandbox.bluebrainnexus.io/v1/projects/... \n", - "10 https://sandbox.bluebrainnexus.io/v1/projects/... \n", - "11 https://sandbox.bluebrainnexus.io/v1/projects/... \n", - "12 https://sandbox.bluebrainnexus.io/v1/projects/... \n", - "13 https://sandbox.bluebrainnexus.io/v1/projects/... \n", - "14 https://sandbox.bluebrainnexus.io/v1/projects/... \n", - "15 https://sandbox.bluebrainnexus.io/v1/projects/... \n", - "16 https://sandbox.bluebrainnexus.io/v1/projects/... \n", - "17 https://sandbox.bluebrainnexus.io/v1/projects/... \n", - "18 https://sandbox.bluebrainnexus.io/v1/projects/... \n", - "19 https://sandbox.bluebrainnexus.io/v1/projects/... \n", - "20 https://sandbox.bluebrainnexus.io/v1/projects/... \n", - "21 https://sandbox.bluebrainnexus.io/v1/projects/... \n", - "\n", - " _self \\\n", - "0 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "1 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "2 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "3 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "4 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "5 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "6 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "7 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "8 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "9 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "10 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "11 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "12 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "13 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "14 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "15 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "16 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "17 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "18 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "19 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "20 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "21 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "\n", - " _updatedAt \\\n", - "0 2022-07-20T15:27:08.356Z \n", - "1 2022-07-20T16:53:40.970Z \n", - "2 2022-07-21T08:56:27.014Z \n", - "3 2022-07-27T09:12:56.220Z \n", - "4 2022-09-27T08:52:13.792Z \n", - "5 2022-09-27T08:55:46.766Z \n", - "6 2022-09-27T09:30:13.621Z \n", - "7 2022-09-27T09:31:31.740Z \n", - "8 2022-09-27T09:33:30.234Z \n", - "9 2022-09-28T14:07:28.848Z \n", - "10 2022-09-28T14:18:23.150Z \n", - "11 2022-09-28T14:20:45.788Z \n", - "12 2022-09-28T14:36:36.556Z \n", - "13 2022-09-28T14:38:13.837Z \n", - "14 2022-11-01T09:35:15.260Z \n", - "15 2022-12-07T08:27:08.594Z \n", - "16 2023-01-17T16:03:46.756Z \n", - "17 2023-01-18T12:16:51.522Z \n", - "18 2023-01-23T13:38:33.743Z \n", - "19 2023-01-25T13:18:11.559Z \n", - "20 2023-01-25T13:24:22.173Z \n", - "21 2023-01-25T13:31:53.616Z \n", - "\n", - " _updatedBy \\\n", - "0 https://sandbox.bluebrainnexus.io/v1/realms/gi... \n", - "1 https://sandbox.bluebrainnexus.io/v1/realms/gi... \n", - "2 https://sandbox.bluebrainnexus.io/v1/realms/gi... \n", - "3 https://sandbox.bluebrainnexus.io/v1/realms/gi... \n", - "4 https://sandbox.bluebrainnexus.io/v1/realms/gi... \n", - "5 https://sandbox.bluebrainnexus.io/v1/realms/gi... \n", - "6 https://sandbox.bluebrainnexus.io/v1/realms/gi... \n", - "7 https://sandbox.bluebrainnexus.io/v1/realms/gi... \n", - "8 https://sandbox.bluebrainnexus.io/v1/realms/gi... \n", - "9 https://sandbox.bluebrainnexus.io/v1/realms/gi... \n", - "10 https://sandbox.bluebrainnexus.io/v1/realms/gi... \n", - "11 https://sandbox.bluebrainnexus.io/v1/realms/gi... \n", - "12 https://sandbox.bluebrainnexus.io/v1/realms/gi... \n", - "13 https://sandbox.bluebrainnexus.io/v1/realms/gi... \n", - "14 https://sandbox.bluebrainnexus.io/v1/realms/gi... \n", - "15 https://sandbox.bluebrainnexus.io/v1/realms/gi... \n", - "16 https://sandbox.bluebrainnexus.io/v1/realms/gi... \n", - "17 https://sandbox.bluebrainnexus.io/v1/realms/gi... \n", - "18 https://sandbox.bluebrainnexus.io/v1/realms/gi... \n", - "19 https://sandbox.bluebrainnexus.io/v1/realms/gi... \n", - "20 https://sandbox.bluebrainnexus.io/v1/realms/gi... \n", - "21 https://sandbox.bluebrainnexus.io/v1/realms/gi... \n", - "\n", - " contribution \n", - "0 NaN \n", - "1 [{'type': 'Contribution', 'agent': {'type': 'P... \n", - "2 [{'type': 'Contribution', 'agent': {'type': 'P... \n", - "3 [{'type': 'Contribution', 'agent': {'type': 'P... \n", - "4 NaN \n", - "5 [{'type': 'Contribution', 'agent': {'type': 'P... \n", - "6 [{'type': 'Contribution', 'agent': {'type': 'P... \n", - "7 [{'type': 'Contribution', 'agent': {'type': 'P... \n", - "8 [{'type': 'Contribution', 'agent': {'type': 'P... \n", - "9 [{'type': 'Contribution', 'agent': {'type': 'P... \n", - "10 [{'type': 'Contribution', 'agent': {'type': 'P... \n", - "11 [{'type': 'Contribution', 'agent': {'type': 'P... \n", - "12 [{'type': 'Contribution', 'agent': {'type': 'P... \n", - "13 [{'type': 'Contribution', 'agent': {'type': 'P... \n", - "14 NaN \n", - "15 NaN \n", - "16 [{'type': 'Contribution', 'agent': {'type': 'P... \n", - "17 [{'type': 'Contribution', 'agent': {'type': 'P... \n", - "18 [{'type': 'Contribution', 'agent': {'type': 'P... \n", - "19 [{'type': 'Contribution', 'agent': {'type': 'P... \n", - "20 [{'type': 'Contribution', 'agent': {'type': 'P... \n", - "21 [{'type': 'Contribution', 'agent': {'type': 'P... \n", - "\n", - "[22 rows x 28 columns]" - ] - }, - "execution_count": 58, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "forge.as_dataframe(resources, store_metadata=True)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Using search endpoints\n", - "\n", - "Two types of search endpoints are supported: 'sparql' (default) for graph queries and 'elastic' for document oriented queries. The types of available search endpoint can be configured (see [00-Initialization.ipynb](00%20-%20Initialization.ipynb) for an example of search endpoints config) or set when creating a KnowledgeGraphForge session using the 'searchendpoints' arguments.\n", - "\n", - "The search endpoint to hit when calling forge.search(...) is 'sparql' by default but can be specified using the 'search_endpoint' argument." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "#### SPARQL Search Endpoint" - ] - }, - { - "cell_type": "code", - "execution_count": 59, - "metadata": {}, - "outputs": [], - "source": [ - "# Search for resources of type Person\n", - "filters = {\"type\": \"Person\"}\n", - "resources = forge.search(filters, limit=3, search_endpoint='sparql')" - ] - }, - { - "cell_type": "code", - "execution_count": 60, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "list" - ] - }, - "execution_count": 60, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "type(resources)" - ] - }, - { - "cell_type": "code", - "execution_count": 61, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "92" - ] - }, - "execution_count": 61, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "len(resources)" - ] - }, - { - "cell_type": "code", - "execution_count": 62, - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
idtypeawardname_constrainedBy_createdAt_createdBy_deprecated_incoming_outgoing...distribution.atLocation.store.iddistribution.atLocation.store.typedistribution.atLocation.store._revdistribution.contentSize.unitCodedistribution.contentSize.valuedistribution.contentUrldistribution.digest.algorithmdistribution.digest.valuedistribution.encodingFormatdistribution.name
0https://sandbox.bluebrainnexus.io/v1/resources...Person[Nobel]Jane Doehttps://bluebrain.github.io/nexus/schemas/unco...2023-01-25T13:18:06.856Zhttps://sandbox.bluebrainnexus.io/v1/realms/gi...Falsehttps://sandbox.bluebrainnexus.io/v1/resources...https://sandbox.bluebrainnexus.io/v1/resources......NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
1https://sandbox.bluebrainnexus.io/v1/resources...Person[Nobel]Jane Doehttps://bluebrain.github.io/nexus/schemas/unco...2023-01-25T13:18:07.458Zhttps://sandbox.bluebrainnexus.io/v1/realms/gi...Falsehttps://sandbox.bluebrainnexus.io/v1/resources...https://sandbox.bluebrainnexus.io/v1/resources......NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
2https://sandbox.bluebrainnexus.io/v1/resources...Person[Nobel]Jane Doehttps://bluebrain.github.io/nexus/schemas/unco...2023-01-25T13:24:17.096Zhttps://sandbox.bluebrainnexus.io/v1/realms/gi...Falsehttps://sandbox.bluebrainnexus.io/v1/resources...https://sandbox.bluebrainnexus.io/v1/resources......NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
3https://sandbox.bluebrainnexus.io/v1/resources...Person[Nobel]Jane Doehttps://bluebrain.github.io/nexus/schemas/unco...2023-01-25T13:24:17.703Zhttps://sandbox.bluebrainnexus.io/v1/realms/gi...Falsehttps://sandbox.bluebrainnexus.io/v1/resources...https://sandbox.bluebrainnexus.io/v1/resources......NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
4https://sandbox.bluebrainnexus.io/v1/resources...Person[Nobel]Jane Doehttps://bluebrain.github.io/nexus/schemas/unco...2023-01-25T13:31:49.101Zhttps://sandbox.bluebrainnexus.io/v1/realms/gi...Falsehttps://sandbox.bluebrainnexus.io/v1/resources...https://sandbox.bluebrainnexus.io/v1/resources......NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
..................................................................
87https://sandbox.bluebrainnexus.io/v1/resources...Person[Nobel]Jane Doehttps://bluebrain.github.io/nexus/schemas/unco...2022-09-27T08:55:43.621Zhttps://sandbox.bluebrainnexus.io/v1/realms/gi...Falsehttps://sandbox.bluebrainnexus.io/v1/resources...https://sandbox.bluebrainnexus.io/v1/resources......NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
88https://sandbox.bluebrainnexus.io/v1/resources...Person[Nobel]Jane Doehttps://bluebrain.github.io/nexus/schemas/unco...2022-09-27T09:30:07.586Zhttps://sandbox.bluebrainnexus.io/v1/realms/gi...Falsehttps://sandbox.bluebrainnexus.io/v1/resources...https://sandbox.bluebrainnexus.io/v1/resources......NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
89https://sandbox.bluebrainnexus.io/v1/resources...Person[Nobel]Jane Doehttps://bluebrain.github.io/nexus/schemas/unco...2022-09-27T09:30:08.654Zhttps://sandbox.bluebrainnexus.io/v1/realms/gi...Falsehttps://sandbox.bluebrainnexus.io/v1/resources...https://sandbox.bluebrainnexus.io/v1/resources......NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
90https://sandbox.bluebrainnexus.io/v1/resources...Person[Nobel]Jane Doehttps://bluebrain.github.io/nexus/schemas/unco...2022-09-27T09:31:18.061Zhttps://sandbox.bluebrainnexus.io/v1/realms/gi...Falsehttps://sandbox.bluebrainnexus.io/v1/resources...https://sandbox.bluebrainnexus.io/v1/resources......NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
91https://sandbox.bluebrainnexus.io/v1/resources...Person[Nobel]Jane Doehttps://bluebrain.github.io/nexus/schemas/unco...2022-09-27T09:31:19.909Zhttps://sandbox.bluebrainnexus.io/v1/realms/gi...Falsehttps://sandbox.bluebrainnexus.io/v1/resources...https://sandbox.bluebrainnexus.io/v1/resources......NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
\n", - "

92 rows × 32 columns

\n", - "
" - ], - "text/plain": [ - " id type award \\\n", - "0 https://sandbox.bluebrainnexus.io/v1/resources... Person [Nobel] \n", - "1 https://sandbox.bluebrainnexus.io/v1/resources... Person [Nobel] \n", - "2 https://sandbox.bluebrainnexus.io/v1/resources... Person [Nobel] \n", - "3 https://sandbox.bluebrainnexus.io/v1/resources... Person [Nobel] \n", - "4 https://sandbox.bluebrainnexus.io/v1/resources... Person [Nobel] \n", - ".. ... ... ... \n", - "87 https://sandbox.bluebrainnexus.io/v1/resources... Person [Nobel] \n", - "88 https://sandbox.bluebrainnexus.io/v1/resources... Person [Nobel] \n", - "89 https://sandbox.bluebrainnexus.io/v1/resources... Person [Nobel] \n", - "90 https://sandbox.bluebrainnexus.io/v1/resources... Person [Nobel] \n", - "91 https://sandbox.bluebrainnexus.io/v1/resources... Person [Nobel] \n", - "\n", - " name _constrainedBy \\\n", - "0 Jane Doe https://bluebrain.github.io/nexus/schemas/unco... \n", - "1 Jane Doe https://bluebrain.github.io/nexus/schemas/unco... \n", - "2 Jane Doe https://bluebrain.github.io/nexus/schemas/unco... \n", - "3 Jane Doe https://bluebrain.github.io/nexus/schemas/unco... \n", - "4 Jane Doe https://bluebrain.github.io/nexus/schemas/unco... \n", - ".. ... ... \n", - "87 Jane Doe https://bluebrain.github.io/nexus/schemas/unco... \n", - "88 Jane Doe https://bluebrain.github.io/nexus/schemas/unco... \n", - "89 Jane Doe https://bluebrain.github.io/nexus/schemas/unco... \n", - "90 Jane Doe https://bluebrain.github.io/nexus/schemas/unco... \n", - "91 Jane Doe https://bluebrain.github.io/nexus/schemas/unco... \n", - "\n", - " _createdAt \\\n", - "0 2023-01-25T13:18:06.856Z \n", - "1 2023-01-25T13:18:07.458Z \n", - "2 2023-01-25T13:24:17.096Z \n", - "3 2023-01-25T13:24:17.703Z \n", - "4 2023-01-25T13:31:49.101Z \n", - ".. ... \n", - "87 2022-09-27T08:55:43.621Z \n", - "88 2022-09-27T09:30:07.586Z \n", - "89 2022-09-27T09:30:08.654Z \n", - "90 2022-09-27T09:31:18.061Z \n", - "91 2022-09-27T09:31:19.909Z \n", - "\n", - " _createdBy _deprecated \\\n", - "0 https://sandbox.bluebrainnexus.io/v1/realms/gi... False \n", - "1 https://sandbox.bluebrainnexus.io/v1/realms/gi... False \n", - "2 https://sandbox.bluebrainnexus.io/v1/realms/gi... False \n", - "3 https://sandbox.bluebrainnexus.io/v1/realms/gi... False \n", - "4 https://sandbox.bluebrainnexus.io/v1/realms/gi... False \n", - ".. ... ... \n", - "87 https://sandbox.bluebrainnexus.io/v1/realms/gi... False \n", - "88 https://sandbox.bluebrainnexus.io/v1/realms/gi... False \n", - "89 https://sandbox.bluebrainnexus.io/v1/realms/gi... False \n", - "90 https://sandbox.bluebrainnexus.io/v1/realms/gi... False \n", - "91 https://sandbox.bluebrainnexus.io/v1/realms/gi... False \n", - "\n", - " _incoming \\\n", - "0 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "1 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "2 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "3 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "4 https://sandbox.bluebrainnexus.io/v1/resources... \n", - ".. ... \n", - "87 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "88 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "89 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "90 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "91 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "\n", - " _outgoing ... \\\n", - "0 https://sandbox.bluebrainnexus.io/v1/resources... ... \n", - "1 https://sandbox.bluebrainnexus.io/v1/resources... ... \n", - "2 https://sandbox.bluebrainnexus.io/v1/resources... ... \n", - "3 https://sandbox.bluebrainnexus.io/v1/resources... ... \n", - "4 https://sandbox.bluebrainnexus.io/v1/resources... ... \n", - ".. ... ... \n", - "87 https://sandbox.bluebrainnexus.io/v1/resources... ... \n", - "88 https://sandbox.bluebrainnexus.io/v1/resources... ... \n", - "89 https://sandbox.bluebrainnexus.io/v1/resources... ... \n", - "90 https://sandbox.bluebrainnexus.io/v1/resources... ... \n", - "91 https://sandbox.bluebrainnexus.io/v1/resources... ... \n", - "\n", - " distribution.atLocation.store.id distribution.atLocation.store.type \\\n", - "0 NaN NaN \n", - "1 NaN NaN \n", - "2 NaN NaN \n", - "3 NaN NaN \n", - "4 NaN NaN \n", - ".. ... ... \n", - "87 NaN NaN \n", - "88 NaN NaN \n", - "89 NaN NaN \n", - "90 NaN NaN \n", - "91 NaN NaN \n", - "\n", - " distribution.atLocation.store._rev distribution.contentSize.unitCode \\\n", - "0 NaN NaN \n", - "1 NaN NaN \n", - "2 NaN NaN \n", - "3 NaN NaN \n", - "4 NaN NaN \n", - ".. ... ... \n", - "87 NaN NaN \n", - "88 NaN NaN \n", - "89 NaN NaN \n", - "90 NaN NaN \n", - "91 NaN NaN \n", - "\n", - " distribution.contentSize.value distribution.contentUrl \\\n", - "0 NaN NaN \n", - "1 NaN NaN \n", - "2 NaN NaN \n", - "3 NaN NaN \n", - "4 NaN NaN \n", - ".. ... ... \n", - "87 NaN NaN \n", - "88 NaN NaN \n", - "89 NaN NaN \n", - "90 NaN NaN \n", - "91 NaN NaN \n", - "\n", - " distribution.digest.algorithm distribution.digest.value \\\n", - "0 NaN NaN \n", - "1 NaN NaN \n", - "2 NaN NaN \n", - "3 NaN NaN \n", - "4 NaN NaN \n", - ".. ... ... \n", - "87 NaN NaN \n", - "88 NaN NaN \n", - "89 NaN NaN \n", - "90 NaN NaN \n", - "91 NaN NaN \n", - "\n", - " distribution.encodingFormat distribution.name \n", - "0 NaN NaN \n", - "1 NaN NaN \n", - "2 NaN NaN \n", - "3 NaN NaN \n", - "4 NaN NaN \n", - ".. ... ... \n", - "87 NaN NaN \n", - "88 NaN NaN \n", - "89 NaN NaN \n", - "90 NaN NaN \n", - "91 NaN NaN \n", - "\n", - "[92 rows x 32 columns]" - ] - }, - "execution_count": 62, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "forge.as_dataframe(resources, store_metadata=True)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "#### ElasticSearch Endpoint" - ] - }, - { - "cell_type": "code", - "execution_count": 63, - "metadata": {}, - "outputs": [], - "source": [ - "# Search for resources of type Person and retrieve their ids and names.\n", - "filters = {\"@type\": \"http://schema.org/Person\"}\n", - "resources = forge.search(filters, limit=3, \n", - " search_endpoint='elastic', \n", - " includes=[\"@id\", \"@type\"]) # fields can also be excluded with 'excludes'" - ] - }, - { - "cell_type": "code", - "execution_count": 64, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "list" - ] - }, - "execution_count": 64, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "type(resources)" - ] - }, - { - "cell_type": "code", - "execution_count": 65, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "3" - ] - }, - "execution_count": 65, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "len(resources)" - ] - }, - { - "cell_type": "code", - "execution_count": 66, - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
idtype
0https://sandbox.bluebrainnexus.io/v1/resources...http://schema.org/Person
1https://sandbox.bluebrainnexus.io/v1/resources...http://schema.org/Person
2https://sandbox.bluebrainnexus.io/v1/resources...http://schema.org/Person
\n", - "
" - ], - "text/plain": [ - " id type\n", - "0 https://sandbox.bluebrainnexus.io/v1/resources... http://schema.org/Person\n", - "1 https://sandbox.bluebrainnexus.io/v1/resources... http://schema.org/Person\n", - "2 https://sandbox.bluebrainnexus.io/v1/resources... http://schema.org/Person" - ] - }, - "execution_count": 66, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "forge.as_dataframe(resources, store_metadata=True)" - ] - }, - { - "cell_type": "code", - "execution_count": 67, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "False" - ] - }, - "execution_count": 67, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "# Search results are not synchronized\n", - "resources[0]._synchronized" - ] - }, - { - "cell_type": "code", - "execution_count": 68, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "'https://sandbox.bluebrainnexus.io/v1/resources/github-users/crisely09/_/0b5441a9-1db9-4cdb-8ec0-afbc4bd25bb5'" - ] - }, - "execution_count": 68, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "resources[0].id" - ] - }, - { - "cell_type": "code", - "execution_count": 69, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "'http://schema.org/Person'" - ] - }, - "execution_count": 69, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "resources[0].type" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Crossbucket search\n", - "It is possible to search for resources stored in buckets different than the configured one. The configured store should of course support it." - ] - }, - { - "cell_type": "code", - "execution_count": 70, - "metadata": {}, - "outputs": [], - "source": [ - "resources = forge.search(p.type.id == \"Association\", limit=3, cross_bucket=True) # cross_bucket defaults to False" - ] - }, - { - "cell_type": "code", - "execution_count": 71, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "list" - ] - }, - "execution_count": 71, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "type(resources)" - ] - }, - { - "cell_type": "code", - "execution_count": 72, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "28" - ] - }, - "execution_count": 72, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "len(resources)" - ] - }, - { - "cell_type": "code", - "execution_count": 73, - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", " \n", " \n", "
idtypeagent.typeagent.gender.idagent.gender.typeagent.gender.labelagent.namedistribution.typedistribution.atLocation.typedistribution.atLocation.store.id...distribution.contentSize.valuedistribution.contentUrldistribution.digest.algorithmdistribution.digest.valuedistribution.encodingFormatdistribution.namenamedistributionagent.idagent
0https://sandbox.bluebrainnexus.io/v1/resources...AssociationPersonhttp://purl.obolibrary.org/obo/PATO_0000384LabeledOntologyEntitymaleAlbert EinsteinDataDownloadLocationhttps://bluebrain.github.io/nexus/vocabulary/d......50.0https://sandbox.bluebrainnexus.io/v1/files/git...SHA-25691a5ce5c84dc5bead730a4b49d0698b4aaef4bc06ce164...text/plainalbert_einstein.txtEinstein AssociationNaNNaNNaN
1https://sandbox.bluebrainnexus.io/v1/resources...AssociationPersonhttp://purl.obolibrary.org/obo/PATO_0000383LabeledOntologyEntityfemaleMarie CurieDataDownloadLocationhttps://bluebrain.github.io/nexus/vocabulary/d......46.0https://sandbox.bluebrainnexus.io/v1/files/git...SHA-256e0fe65f725bf28fe2b88c7bafb51fb5ef1df0ab14c68a3...text/plainmarie_curie.txtCurie AssociationNaNNaNNaN
2https://sandbox.bluebrainnexus.io/v1/resources...AssociationPersonNaNNaNNaNJane DoeNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
3https://sandbox.bluebrainnexus.io/v1/resources...AssociationPersonNaNNaNNaNJohn SmithNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
4https://sandbox.bluebrainnexus.io/v1/resources...AssociationPersonNaNNaNNaNJane DoeNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
5https://sandbox.bluebrainnexus.io/v1/resources...AssociationPersonNaNNaNNaNJohn SmithNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
6https://sandbox.bluebrainnexus.io/v1/resources...AssociationPersonNaNNaNNaNJane DoeNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaN[{'type': 'DataDownload', 'atLocation': {'type...NaNNaN
7https://sandbox.bluebrainnexus.io/v1/resources...AssociationPersonNaNNaNNaNJane DoeNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNhttps://sandbox.bluebrainnexus.io/v1/resources...NaN
8https://sandbox.bluebrainnexus.io/v1/resources...AssociationNaNNaNNaNNaNNaNNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaN[{'id': 'https://sandbox.bluebrainnexus.io/v1/...
9https://sandbox.bluebrainnexus.io/v1/resources...AssociationPersonhttp://purl.obolibrary.org/obo/PATO_0000383LabeledOntologyEntityfemaleMarie CurieDataDownloadLocationhttps://bluebrain.github.io/nexus/vocabulary/d......46.0https://sandbox.bluebrainnexus.io/v1/files/git...SHA-256e0fe65f725bf28fe2b88c7bafb51fb5ef1df0ab14c68a3...text/plainmarie_curie.txtCurie AssociationNaNNaNNaN
10https://sandbox.bluebrainnexus.io/v1/resources...AssociationPersonhttp://purl.obolibrary.org/obo/PATO_0000384LabeledOntologyEntitymaleAlbert EinsteinDataDownloadLocationhttps://bluebrain.github.io/nexus/vocabulary/d......50.0https://sandbox.bluebrainnexus.io/v1/files/git...SHA-25691a5ce5c84dc5bead730a4b49d0698b4aaef4bc06ce164...text/plainalbert_einstein.txtEinstein AssociationNaNNaNNaN
11https://sandbox.bluebrainnexus.io/v1/resources...AssociationPersonNaNNaNNaNJane DoeNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
12https://sandbox.bluebrainnexus.io/v1/resources...AssociationPersonNaNNaNNaNJohn SmithNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
13https://sandbox.bluebrainnexus.io/v1/resources...AssociationPersonNaNNaNNaNJane DoeNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaN[{'type': 'DataDownload', 'atLocation': {'type...NaNNaN
14https://sandbox.bluebrainnexus.io/v1/resources...AssociationPersonNaNNaNNaNJane DoeNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaN[{'type': 'DataDownload', 'atLocation': {'type...NaNNaN
15https://sandbox.bluebrainnexus.io/v1/resources...AssociationPersonNaNNaNNaNJane DoeNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaN[{'type': 'DataDownload', 'atLocation': {'type...NaNNaN
16https://sandbox.bluebrainnexus.io/v1/resources...AssociationPersonNaNNaNNaNJane DoeNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNhttps://sandbox.bluebrainnexus.io/v1/resources...NaN
17https://sandbox.bluebrainnexus.io/v1/resources...AssociationNaNNaNNaNNaNNaNNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaN[{'id': 'https://sandbox.bluebrainnexus.io/v1/...
18https://sandbox.bluebrainnexus.io/v1/resources...AssociationPersonNaNNaNNaNJane DoeNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaN[{'type': 'DataDownload', 'atLocation': {'type...NaNNaN
19https://sandbox.bluebrainnexus.io/v1/resources...AssociationPersonNaNNaNNaNJane DoeNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaN[{'type': 'DataDownload', 'atLocation': {'type...NaNNaN
20https://sandbox.bluebrainnexus.io/v1/resources...AssociationPersonNaNNaNNaNJane DoeNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaN[{'type': 'DataDownload', 'atLocation': {'type...NaNNaN
21https://sandbox.bluebrainnexus.io/v1/resources...AssociationPersonNaNNaNNaNJane DoeNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaN[{'type': 'DataDownload', 'atLocation': {'type...NaNNaN
22https://sandbox.bluebrainnexus.io/v1/resources...AssociationPersonhttp://purl.obolibrary.org/obo/PATO_0000383LabeledOntologyEntityfemaleMarie CurieDataDownloadLocationhttps://bluebrain.github.io/nexus/vocabulary/d......46.0https://sandbox.bluebrainnexus.io/v1/files/git...SHA-256e0fe65f725bf28fe2b88c7bafb51fb5ef1df0ab14c68a3...text/plainmarie_curie.txtCurie AssociationNaNNaNNaN
23https://sandbox.bluebrainnexus.io/v1/resources...AssociationPersonhttp://purl.obolibrary.org/obo/PATO_0000384LabeledOntologyEntitymaleAlbert EinsteinDataDownloadLocationhttps://bluebrain.github.io/nexus/vocabulary/d......50.0https://sandbox.bluebrainnexus.io/v1/files/git...SHA-25691a5ce5c84dc5bead730a4b49d0698b4aaef4bc06ce164...text/plainalbert_einstein.txtEinstein AssociationNaNNaNNaN
24https://sandbox.bluebrainnexus.io/v1/resources...AssociationPersonhttp://purl.obolibrary.org/obo/PATO_0000384LabeledOntologyEntitymaleAlbert EinsteinDataDownloadLocationhttps://bluebrain.github.io/nexus/vocabulary/d......50.0https://sandbox.bluebrainnexus.io/v1/files/git...SHA-25691a5ce5c84dc5bead730a4b49d0698b4aaef4bc06ce164...text/plainalbert_einstein.txtEinstein AssociationNaNNaNNaN
25https://sandbox.bluebrainnexus.io/v1/resources...AssociationPersonhttp://purl.obolibrary.org/obo/PATO_0000383LabeledOntologyEntityfemaleMarie CurieDataDownloadLocationhttps://bluebrain.github.io/nexus/vocabulary/d......46.0https://sandbox.bluebrainnexus.io/v1/files/git...SHA-256e0fe65f725bf28fe2b88c7bafb51fb5ef1df0ab14c68a3...text/plainmarie_curie.txtCurie AssociationNaNNaNNaN
26https://sandbox.bluebrainnexus.io/v1/resources...AssociationPersonNaNNaNNaNJane DoeNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaN[{'type': 'DataDownload', 'atLocation': {'type...NaNNaN
27https://sandbox.bluebrainnexus.io/v1/resources...AssociationPersonNaNNaNNaNJane DoeNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaN[{'type': 'DataDownload', 'atLocation': {'type...NaNNaNhttp://schema.org/Person
\n", - "

28 rows × 23 columns

\n", "
" ], "text/plain": [ - " id type agent.type \\\n", - "0 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", - "1 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", - "2 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", - "3 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", - "4 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", - "5 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", - "6 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", - "7 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", - "8 https://sandbox.bluebrainnexus.io/v1/resources... Association NaN \n", - "9 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", - "10 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", - "11 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", - "12 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", - "13 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", - "14 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", - "15 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", - "16 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", - "17 https://sandbox.bluebrainnexus.io/v1/resources... Association NaN \n", - "18 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", - "19 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", - "20 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", - "21 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", - "22 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", - "23 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", - "24 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", - "25 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", - "26 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", - "27 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", - "\n", - " agent.gender.id agent.gender.type \\\n", - "0 http://purl.obolibrary.org/obo/PATO_0000384 LabeledOntologyEntity \n", - "1 http://purl.obolibrary.org/obo/PATO_0000383 LabeledOntologyEntity \n", - "2 NaN NaN \n", - "3 NaN NaN \n", - "4 NaN NaN \n", - "5 NaN NaN \n", - "6 NaN NaN \n", - "7 NaN NaN \n", - "8 NaN NaN \n", - "9 http://purl.obolibrary.org/obo/PATO_0000383 LabeledOntologyEntity \n", - "10 http://purl.obolibrary.org/obo/PATO_0000384 LabeledOntologyEntity \n", - "11 NaN NaN \n", - "12 NaN NaN \n", - "13 NaN NaN \n", - "14 NaN NaN \n", - "15 NaN NaN \n", - "16 NaN NaN \n", - "17 NaN NaN \n", - "18 NaN NaN \n", - "19 NaN NaN \n", - "20 NaN NaN \n", - "21 NaN NaN \n", - "22 http://purl.obolibrary.org/obo/PATO_0000383 LabeledOntologyEntity \n", - "23 http://purl.obolibrary.org/obo/PATO_0000384 LabeledOntologyEntity \n", - "24 http://purl.obolibrary.org/obo/PATO_0000384 LabeledOntologyEntity \n", - "25 http://purl.obolibrary.org/obo/PATO_0000383 LabeledOntologyEntity \n", - "26 NaN NaN \n", - "27 NaN NaN \n", - "\n", - " agent.gender.label agent.name distribution.type \\\n", - "0 male Albert Einstein DataDownload \n", - "1 female Marie Curie DataDownload \n", - "2 NaN Jane Doe NaN \n", - "3 NaN John Smith NaN \n", - "4 NaN Jane Doe NaN \n", - "5 NaN John Smith NaN \n", - "6 NaN Jane Doe NaN \n", - "7 NaN Jane Doe NaN \n", - "8 NaN NaN NaN \n", - "9 female Marie Curie DataDownload \n", - "10 male Albert Einstein DataDownload \n", - "11 NaN Jane Doe NaN \n", - "12 NaN John Smith NaN \n", - "13 NaN Jane Doe NaN \n", - "14 NaN Jane Doe NaN \n", - "15 NaN Jane Doe NaN \n", - "16 NaN Jane Doe NaN \n", - "17 NaN NaN NaN \n", - "18 NaN Jane Doe NaN \n", - "19 NaN Jane Doe NaN \n", - "20 NaN Jane Doe NaN \n", - "21 NaN Jane Doe NaN \n", - "22 female Marie Curie DataDownload \n", - "23 male Albert Einstein DataDownload \n", - "24 male Albert Einstein DataDownload \n", - "25 female Marie Curie DataDownload \n", - "26 NaN Jane Doe NaN \n", - "27 NaN Jane Doe NaN \n", - "\n", - " distribution.atLocation.type \\\n", - "0 Location \n", - "1 Location \n", - "2 NaN \n", - "3 NaN \n", - "4 NaN \n", - "5 NaN \n", - "6 NaN \n", - "7 NaN \n", - "8 NaN \n", - "9 Location \n", - "10 Location \n", - "11 NaN \n", - "12 NaN \n", - "13 NaN \n", - "14 NaN \n", - "15 NaN \n", - "16 NaN \n", - "17 NaN \n", - "18 NaN \n", - "19 NaN \n", - "20 NaN \n", - "21 NaN \n", - "22 Location \n", - "23 Location \n", - "24 Location \n", - "25 Location \n", - "26 NaN \n", - "27 NaN \n", - "\n", - " distribution.atLocation.store.id ... \\\n", - "0 https://bluebrain.github.io/nexus/vocabulary/d... ... \n", - "1 https://bluebrain.github.io/nexus/vocabulary/d... ... \n", - "2 NaN ... \n", - "3 NaN ... \n", - "4 NaN ... \n", - "5 NaN ... \n", - "6 NaN ... \n", - "7 NaN ... \n", - "8 NaN ... \n", - "9 https://bluebrain.github.io/nexus/vocabulary/d... ... \n", - "10 https://bluebrain.github.io/nexus/vocabulary/d... ... \n", - "11 NaN ... \n", - "12 NaN ... \n", - "13 NaN ... \n", - "14 NaN ... \n", - "15 NaN ... \n", - "16 NaN ... \n", - "17 NaN ... \n", - "18 NaN ... \n", - "19 NaN ... \n", - "20 NaN ... \n", - "21 NaN ... \n", - "22 https://bluebrain.github.io/nexus/vocabulary/d... ... \n", - "23 https://bluebrain.github.io/nexus/vocabulary/d... ... \n", - "24 https://bluebrain.github.io/nexus/vocabulary/d... ... \n", - "25 https://bluebrain.github.io/nexus/vocabulary/d... ... \n", - "26 NaN ... \n", - "27 NaN ... \n", - "\n", - " distribution.contentSize.value \\\n", - "0 50.0 \n", - "1 46.0 \n", - "2 NaN \n", - "3 NaN \n", - "4 NaN \n", - "5 NaN \n", - "6 NaN \n", - "7 NaN \n", - "8 NaN \n", - "9 46.0 \n", - "10 50.0 \n", - "11 NaN \n", - "12 NaN \n", - "13 NaN \n", - "14 NaN \n", - "15 NaN \n", - "16 NaN \n", - "17 NaN \n", - "18 NaN \n", - "19 NaN \n", - "20 NaN \n", - "21 NaN \n", - "22 46.0 \n", - "23 50.0 \n", - "24 50.0 \n", - "25 46.0 \n", - "26 NaN \n", - "27 NaN \n", - "\n", - " distribution.contentUrl \\\n", - "0 https://sandbox.bluebrainnexus.io/v1/files/git... \n", - "1 https://sandbox.bluebrainnexus.io/v1/files/git... \n", - "2 NaN \n", - "3 NaN \n", - "4 NaN \n", - "5 NaN \n", - "6 NaN \n", - "7 NaN \n", - "8 NaN \n", - "9 https://sandbox.bluebrainnexus.io/v1/files/git... \n", - "10 https://sandbox.bluebrainnexus.io/v1/files/git... \n", - "11 NaN \n", - "12 NaN \n", - "13 NaN \n", - "14 NaN \n", - "15 NaN \n", - "16 NaN \n", - "17 NaN \n", - "18 NaN \n", - "19 NaN \n", - "20 NaN \n", - "21 NaN \n", - "22 https://sandbox.bluebrainnexus.io/v1/files/git... \n", - "23 https://sandbox.bluebrainnexus.io/v1/files/git... \n", - "24 https://sandbox.bluebrainnexus.io/v1/files/git... \n", - "25 https://sandbox.bluebrainnexus.io/v1/files/git... \n", - "26 NaN \n", - "27 NaN \n", - "\n", - " distribution.digest.algorithm \\\n", - "0 SHA-256 \n", - "1 SHA-256 \n", - "2 NaN \n", - "3 NaN \n", - "4 NaN \n", - "5 NaN \n", - "6 NaN \n", - "7 NaN \n", - "8 NaN \n", - "9 SHA-256 \n", - "10 SHA-256 \n", - "11 NaN \n", - "12 NaN \n", - "13 NaN \n", - "14 NaN \n", - "15 NaN \n", - "16 NaN \n", - "17 NaN \n", - "18 NaN \n", - "19 NaN \n", - "20 NaN \n", - "21 NaN \n", - "22 SHA-256 \n", - "23 SHA-256 \n", - "24 SHA-256 \n", - "25 SHA-256 \n", - "26 NaN \n", - "27 NaN \n", - "\n", - " distribution.digest.value \\\n", - "0 91a5ce5c84dc5bead730a4b49d0698b4aaef4bc06ce164... \n", - "1 e0fe65f725bf28fe2b88c7bafb51fb5ef1df0ab14c68a3... \n", - "2 NaN \n", - "3 NaN \n", - "4 NaN \n", - "5 NaN \n", - "6 NaN \n", - "7 NaN \n", - "8 NaN \n", - "9 e0fe65f725bf28fe2b88c7bafb51fb5ef1df0ab14c68a3... \n", - "10 91a5ce5c84dc5bead730a4b49d0698b4aaef4bc06ce164... \n", - "11 NaN \n", - "12 NaN \n", - "13 NaN \n", - "14 NaN \n", - "15 NaN \n", - "16 NaN \n", - "17 NaN \n", - "18 NaN \n", - "19 NaN \n", - "20 NaN \n", - "21 NaN \n", - "22 e0fe65f725bf28fe2b88c7bafb51fb5ef1df0ab14c68a3... \n", - "23 91a5ce5c84dc5bead730a4b49d0698b4aaef4bc06ce164... \n", - "24 91a5ce5c84dc5bead730a4b49d0698b4aaef4bc06ce164... \n", - "25 e0fe65f725bf28fe2b88c7bafb51fb5ef1df0ab14c68a3... \n", - "26 NaN \n", - "27 NaN \n", - "\n", - " distribution.encodingFormat distribution.name name \\\n", - "0 text/plain albert_einstein.txt Einstein Association \n", - "1 text/plain marie_curie.txt Curie Association \n", - "2 NaN NaN NaN \n", - "3 NaN NaN NaN \n", - "4 NaN NaN NaN \n", - "5 NaN NaN NaN \n", - "6 NaN NaN NaN \n", - "7 NaN NaN NaN \n", - "8 NaN NaN NaN \n", - "9 text/plain marie_curie.txt Curie Association \n", - "10 text/plain albert_einstein.txt Einstein Association \n", - "11 NaN NaN NaN \n", - "12 NaN NaN NaN \n", - "13 NaN NaN NaN \n", - "14 NaN NaN NaN \n", - "15 NaN NaN NaN \n", - "16 NaN NaN NaN \n", - "17 NaN NaN NaN \n", - "18 NaN NaN NaN \n", - "19 NaN NaN NaN \n", - "20 NaN NaN NaN \n", - "21 NaN NaN NaN \n", - "22 text/plain marie_curie.txt Curie Association \n", - "23 text/plain albert_einstein.txt Einstein Association \n", - "24 text/plain albert_einstein.txt Einstein Association \n", - "25 text/plain marie_curie.txt Curie Association \n", - "26 NaN NaN NaN \n", - "27 NaN NaN NaN \n", - "\n", - " distribution \\\n", - "0 NaN \n", - "1 NaN \n", - "2 NaN \n", - "3 NaN \n", - "4 NaN \n", - "5 NaN \n", - "6 [{'type': 'DataDownload', 'atLocation': {'type... \n", - "7 NaN \n", - "8 NaN \n", - "9 NaN \n", - "10 NaN \n", - "11 NaN \n", - "12 NaN \n", - "13 [{'type': 'DataDownload', 'atLocation': {'type... \n", - "14 [{'type': 'DataDownload', 'atLocation': {'type... \n", - "15 [{'type': 'DataDownload', 'atLocation': {'type... \n", - "16 NaN \n", - "17 NaN \n", - "18 [{'type': 'DataDownload', 'atLocation': {'type... \n", - "19 [{'type': 'DataDownload', 'atLocation': {'type... \n", - "20 [{'type': 'DataDownload', 'atLocation': {'type... \n", - "21 [{'type': 'DataDownload', 'atLocation': {'type... \n", - "22 NaN \n", - "23 NaN \n", - "24 NaN \n", - "25 NaN \n", - "26 [{'type': 'DataDownload', 'atLocation': {'type... \n", - "27 [{'type': 'DataDownload', 'atLocation': {'type... \n", - "\n", - " agent.id \\\n", - "0 NaN \n", - "1 NaN \n", - "2 NaN \n", - "3 NaN \n", - "4 NaN \n", - "5 NaN \n", - "6 NaN \n", - "7 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "8 NaN \n", - "9 NaN \n", - "10 NaN \n", - "11 NaN \n", - "12 NaN \n", - "13 NaN \n", - "14 NaN \n", - "15 NaN \n", - "16 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "17 NaN \n", - "18 NaN \n", - "19 NaN \n", - "20 NaN \n", - "21 NaN \n", - "22 NaN \n", - "23 NaN \n", - "24 NaN \n", - "25 NaN \n", - "26 NaN \n", - "27 NaN \n", - "\n", - " agent \n", - "0 NaN \n", - "1 NaN \n", - "2 NaN \n", - "3 NaN \n", - "4 NaN \n", - "5 NaN \n", - "6 NaN \n", - "7 NaN \n", - "8 [{'id': 'https://sandbox.bluebrainnexus.io/v1/... \n", - "9 NaN \n", - "10 NaN \n", - "11 NaN \n", - "12 NaN \n", - "13 NaN \n", - "14 NaN \n", - "15 NaN \n", - "16 NaN \n", - "17 [{'id': 'https://sandbox.bluebrainnexus.io/v1/... \n", - "18 NaN \n", - "19 NaN \n", - "20 NaN \n", - "21 NaN \n", - "22 NaN \n", - "23 NaN \n", - "24 NaN \n", - "25 NaN \n", - "26 NaN \n", - "27 NaN \n", - "\n", - "[28 rows x 23 columns]" + " id type\n", + "0 https://sandbox.bluebrainnexus.io/v1/resources... http://schema.org/Person\n", + "1 https://sandbox.bluebrainnexus.io/v1/resources... http://schema.org/Person\n", + "2 https://sandbox.bluebrainnexus.io/v1/resources... http://schema.org/Person" ] }, - "execution_count": 73, + "execution_count": 72, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "forge.as_dataframe(resources)" - ] - }, - { - "cell_type": "code", - "execution_count": 74, - "metadata": {}, - "outputs": [], - "source": [ - "#Furthermore it is possible to filter by bucket when cross_bucket is set to True. Setting a bucket value when cross_bucket is False will trigger a not_supported exception.\n", - "resources = forge.search(p.type.id == \"Person\", limit=3, cross_bucket=True, bucket=\"dke/kgforge\") # add a bucket" + "forge.as_dataframe(resources, store_metadata=True)" ] }, { "cell_type": "code", - "execution_count": 75, + "execution_count": 73, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "list" + "False" ] }, - "execution_count": 75, + "execution_count": 73, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "type(resources)" + "# Search results are not synchronized\n", + "resources[0]._synchronized" ] }, { "cell_type": "code", - "execution_count": 76, + "execution_count": 74, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "0" + "'https://sandbox.bluebrainnexus.io/v1/resources/github-users/crisely09/_/e491b538-0fc4-4fae-b5f7-aaf80839dbe5'" ] }, - "execution_count": 76, + "execution_count": 74, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "len(resources)" + "resources[0].id" ] }, { "cell_type": "code", - "execution_count": 77, + "execution_count": 75, "metadata": {}, "outputs": [ { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
\n", - "
" - ], - "text/plain": [ - "Empty DataFrame\n", - "Columns: []\n", - "Index: []" + "data": { + "text/plain": [ + "'http://schema.org/Person'" ] }, - "execution_count": 77, + "execution_count": 75, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "forge.as_dataframe(resources)" + "resources[0].type" ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ - "### Searching original source\n", - "When using BlueBrainNexusStore, it is possible to retrieve resources' payload as they were registered (retrieve_source=True) without any changes related to store added metadata or JSONLD framing." + "### Crossbucket search\n", + "It is possible to search for resources stored in buckets different than the configured one. The configured store should of course support it." ] }, { "cell_type": "code", - "execution_count": 78, + "execution_count": 76, "metadata": {}, "outputs": [], "source": [ - "resources = forge.search(p.type.id == \"Association\", limit=3, retrieve_source=False) # retrieve_source defaults to True" + "resources = forge.search(p.type.id == \"Association\", limit=3, cross_bucket=True) # cross_bucket defaults to False" ] }, { "cell_type": "code", - "execution_count": 79, + "execution_count": 77, "metadata": {}, "outputs": [ { @@ -5757,7 +2520,7 @@ "list" ] }, - "execution_count": 79, + "execution_count": 77, "metadata": {}, "output_type": "execute_result" } @@ -5768,16 +2531,16 @@ }, { "cell_type": "code", - "execution_count": 80, + "execution_count": 78, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "28" + "3" ] }, - "execution_count": 80, + "execution_count": 78, "metadata": {}, "output_type": "execute_result" } @@ -5788,7 +2551,7 @@ }, { "cell_type": "code", - "execution_count": 81, + "execution_count": 79, "metadata": {}, "outputs": [ { @@ -5809,251 +2572,34 @@ " }\n", "\n", "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", + " \n", + " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -6064,7 +2610,9 @@ " \n", " \n", " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", " \n", @@ -6072,287 +2620,42 @@ " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", - " \n", " \n", " \n", " \n", @@ -6360,12 +2663,287 @@ " \n", " \n", " \n", - " \n", " \n", " \n", + " \n", + " \n", + " \n", + "
idtypeagent.typeagent.gender.idagent.gender.typeagent.gender.labelagent.namedistribution.typedistribution.atLocation.typedistribution.atLocation.store.id...distribution.contentSize.valuedistribution.contentUrldistribution.digest.algorithmdistribution.digest.valuedistribution.encodingFormatdistribution.namenamedistributionagent.idagent
0https://sandbox.bluebrainnexus.io/v1/resources...AssociationPersonhttp://purl.obolibrary.org/obo/PATO_0000384LabeledOntologyEntitymaleAlbert EinsteinDataDownloadLocationhttps://bluebrain.github.io/nexus/vocabulary/d......50.0https://sandbox.bluebrainnexus.io/v1/files/git...SHA-25691a5ce5c84dc5bead730a4b49d0698b4aaef4bc06ce164...text/plainalbert_einstein.txtEinstein AssociationNaNNaNNaN
1https://sandbox.bluebrainnexus.io/v1/resources...AssociationPersonhttp://purl.obolibrary.org/obo/PATO_0000383LabeledOntologyEntityfemaleMarie CurieDataDownloadLocationhttps://bluebrain.github.io/nexus/vocabulary/d......46.0https://sandbox.bluebrainnexus.io/v1/files/git...SHA-256e0fe65f725bf28fe2b88c7bafb51fb5ef1df0ab14c68a3...text/plainmarie_curie.txtCurie AssociationNaNNaNNaN
2https://sandbox.bluebrainnexus.io/v1/resources...AssociationPersonNaNNaNNaNJane DoeNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
3https://sandbox.bluebrainnexus.io/v1/resources...AssociationPersonNaNNaNNaNJohn SmithNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
4https://sandbox.bluebrainnexus.io/v1/resources...AssociationPersonNaNNaNNaNJane DoeNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
5https://sandbox.bluebrainnexus.io/v1/resources...AssociationPersonNaNNaNNaNJohn SmithNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
6https://sandbox.bluebrainnexus.io/v1/resources...AssociationPersonNaNNaNNaNJane DoeNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaN[{'type': 'DataDownload', 'atLocation': {'type...NaNNaN
7https://sandbox.bluebrainnexus.io/v1/resources...AssociationPersonNaNNaNNaNJane DoeNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNhttps://sandbox.bluebrainnexus.io/v1/resources...NaN
8https://sandbox.bluebrainnexus.io/v1/resources...AssociationNaNNaNNaNNaNNaNNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaN[{'id': 'https://sandbox.bluebrainnexus.io/v1/...
idtypeagent.typeagent.gender.idagent.gender.typeagent.gender.labelagent.namedistribution.typedistribution.atLocation.typedistribution.atLocation.store.iddistribution.atLocation.store.typedistribution.atLocation.store._revdistribution.contentSize.unitCodedistribution.contentSize.valuedistribution.contentUrldistribution.digest.algorithmdistribution.digest.valuedistribution.encodingFormatdistribution.namename
90https://sandbox.bluebrainnexus.io/v1/resources...AssociationPersonDataDownloadLocationhttps://bluebrain.github.io/nexus/vocabulary/d......DiskStorage1.0bytes46.0https://sandbox.bluebrainnexus.io/v1/files/git...SHA-256text/plainmarie_curie.txtCurie AssociationNaNNaNNaN
10https://sandbox.bluebrainnexus.io/v1/resources...AssociationPersonhttp://purl.obolibrary.org/obo/PATO_0000384LabeledOntologyEntitymaleAlbert EinsteinDataDownloadLocationhttps://bluebrain.github.io/nexus/vocabulary/d......50.0https://sandbox.bluebrainnexus.io/v1/files/git...SHA-25691a5ce5c84dc5bead730a4b49d0698b4aaef4bc06ce164...text/plainalbert_einstein.txtEinstein AssociationNaNNaNNaN
11https://sandbox.bluebrainnexus.io/v1/resources...AssociationPersonNaNNaNNaNJane DoeNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
12https://sandbox.bluebrainnexus.io/v1/resources...AssociationPersonNaNNaNNaNJohn SmithNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
13https://sandbox.bluebrainnexus.io/v1/resources...AssociationPersonNaNNaNNaNJane DoeNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaN[{'type': 'DataDownload', 'atLocation': {'type...NaNNaN
14https://sandbox.bluebrainnexus.io/v1/resources...AssociationPersonNaNNaNNaNJane DoeNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaN[{'type': 'DataDownload', 'atLocation': {'type...NaNNaN
15https://sandbox.bluebrainnexus.io/v1/resources...AssociationPersonNaNNaNNaNJane DoeNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaN[{'type': 'DataDownload', 'atLocation': {'type...NaNNaN
16https://sandbox.bluebrainnexus.io/v1/resources...AssociationPersonNaNNaNNaNJane DoeNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNhttps://sandbox.bluebrainnexus.io/v1/resources...NaN
17https://sandbox.bluebrainnexus.io/v1/resources...AssociationNaNNaNNaNNaNNaNNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaN[{'id': 'https://sandbox.bluebrainnexus.io/v1/...
18https://sandbox.bluebrainnexus.io/v1/resources...AssociationPersonNaNNaNNaNJane DoeNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaN[{'type': 'DataDownload', 'atLocation': {'type...NaNNaN
19https://sandbox.bluebrainnexus.io/v1/resources...AssociationPersonNaNNaNNaNJane DoeNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaN[{'type': 'DataDownload', 'atLocation': {'type...NaNNaN
201https://sandbox.bluebrainnexus.io/v1/resources...AssociationPersonNaNNaNNaNJane DoeNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaN[{'type': 'DataDownload', 'atLocation': {'type...NaNNaNhttp://purl.obolibrary.org/obo/PATO_0000384LabeledOntologyEntitymaleAlbert EinsteinDataDownloadLocationhttps://bluebrain.github.io/nexus/vocabulary/d...DiskStorage1.0bytes50.0https://sandbox.bluebrainnexus.io/v1/files/git...SHA-25691a5ce5c84dc5bead730a4b49d0698b4aaef4bc06ce164...text/plainalbert_einstein.txtEinstein Association
212https://sandbox.bluebrainnexus.io/v1/resources...AssociationPersonNaNNaNNaNJane DoeJohn SmithNaNNaNNaN...NaNNaNNaNNaNNaNNaN[{'type': 'DataDownload', 'atLocation': {'type...NaNNaNNaN
\n", + "" + ], + "text/plain": [ + " id type agent.type \\\n", + "0 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", + "1 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", + "2 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", + "\n", + " agent.gender.id agent.gender.type \\\n", + "0 http://purl.obolibrary.org/obo/PATO_0000383 LabeledOntologyEntity \n", + "1 http://purl.obolibrary.org/obo/PATO_0000384 LabeledOntologyEntity \n", + "2 NaN NaN \n", + "\n", + " agent.gender.label agent.name distribution.type \\\n", + "0 female Marie Curie DataDownload \n", + "1 male Albert Einstein DataDownload \n", + "2 NaN John Smith NaN \n", + "\n", + " distribution.atLocation.type \\\n", + "0 Location \n", + "1 Location \n", + "2 NaN \n", + "\n", + " distribution.atLocation.store.id \\\n", + "0 https://bluebrain.github.io/nexus/vocabulary/d... \n", + "1 https://bluebrain.github.io/nexus/vocabulary/d... \n", + "2 NaN \n", + "\n", + " distribution.atLocation.store.type distribution.atLocation.store._rev \\\n", + "0 DiskStorage 1.0 \n", + "1 DiskStorage 1.0 \n", + "2 NaN NaN \n", + "\n", + " distribution.contentSize.unitCode distribution.contentSize.value \\\n", + "0 bytes 46.0 \n", + "1 bytes 50.0 \n", + "2 NaN NaN \n", + "\n", + " distribution.contentUrl \\\n", + "0 https://sandbox.bluebrainnexus.io/v1/files/git... \n", + "1 https://sandbox.bluebrainnexus.io/v1/files/git... \n", + "2 NaN \n", + "\n", + " distribution.digest.algorithm \\\n", + "0 SHA-256 \n", + "1 SHA-256 \n", + "2 NaN \n", + "\n", + " distribution.digest.value \\\n", + "0 e0fe65f725bf28fe2b88c7bafb51fb5ef1df0ab14c68a3... \n", + "1 91a5ce5c84dc5bead730a4b49d0698b4aaef4bc06ce164... \n", + "2 NaN \n", + "\n", + " distribution.encodingFormat distribution.name name \n", + "0 text/plain marie_curie.txt Curie Association \n", + "1 text/plain albert_einstein.txt Einstein Association \n", + "2 NaN NaN NaN " + ] + }, + "execution_count": 79, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "forge.as_dataframe(resources)" + ] + }, + { + "cell_type": "code", + "execution_count": 80, + "metadata": {}, + "outputs": [], + "source": [ + "#Furthermore it is possible to filter by bucket when cross_bucket is set to True. Setting a bucket value when cross_bucket is False will trigger a not_supported exception.\n", + "resources = forge.search(p.type.id == \"Person\", limit=3, cross_bucket=True, bucket=\"dke/kgforge\") # add a bucket" + ] + }, + { + "cell_type": "code", + "execution_count": 81, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "list" + ] + }, + "execution_count": 81, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "type(resources)" + ] + }, + { + "cell_type": "code", + "execution_count": 82, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "0" + ] + }, + "execution_count": 82, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "len(resources)" + ] + }, + { + "cell_type": "code", + "execution_count": 83, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
\n", + "
" + ], + "text/plain": [ + "Empty DataFrame\n", + "Columns: []\n", + "Index: []" + ] + }, + "execution_count": 83, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "forge.as_dataframe(resources)" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Searching original source\n", + "When using BlueBrainNexusStore, it is possible to retrieve resources' payload as they were registered (retrieve_source=True) without any changes related to store added metadata or JSONLD framing." + ] + }, + { + "cell_type": "code", + "execution_count": 84, + "metadata": {}, + "outputs": [], + "source": [ + "resources = forge.search(p.type.id == \"Association\", limit=3, retrieve_source=False) # retrieve_source defaults to True" + ] + }, + { + "cell_type": "code", + "execution_count": 85, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "list" + ] + }, + "execution_count": 85, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "type(resources)" + ] + }, + { + "cell_type": "code", + "execution_count": 86, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "3" + ] + }, + "execution_count": 86, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "len(resources)" + ] + }, + { + "cell_type": "code", + "execution_count": 87, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", + " \n", + " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -6376,7 +2954,9 @@ " \n", " \n", " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", " \n", @@ -6384,36 +2964,9 @@ " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -6424,7 +2977,9 @@ " \n", " \n", " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", " \n", @@ -6432,71 +2987,20 @@ " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", " \n", - " \n", " \n", " \n", " \n", - " \n", " \n", " \n", " \n", @@ -6504,410 +3008,71 @@ " \n", " \n", " \n", - " \n", " \n", " \n", " \n", " \n", "
idtypeagent.typeagent.gender.idagent.gender.typeagent.gender.labelagent.namedistribution.typedistribution.atLocation.typedistribution.atLocation.store.iddistribution.atLocation.store.typedistribution.atLocation.store._revdistribution.contentSize.unitCodedistribution.contentSize.valuedistribution.contentUrldistribution.digest.algorithmdistribution.digest.valuedistribution.encodingFormatdistribution.namename
220https://sandbox.bluebrainnexus.io/v1/resources...AssociationPersonDataDownloadLocationhttps://bluebrain.github.io/nexus/vocabulary/d......DiskStorage1.0bytes46.0https://sandbox.bluebrainnexus.io/v1/files/git...SHA-256text/plainmarie_curie.txtCurie AssociationNaNNaNNaN
23https://sandbox.bluebrainnexus.io/v1/resources...AssociationPersonhttp://purl.obolibrary.org/obo/PATO_0000384LabeledOntologyEntitymaleAlbert EinsteinDataDownloadLocationhttps://bluebrain.github.io/nexus/vocabulary/d......50.0https://sandbox.bluebrainnexus.io/v1/files/git...SHA-25691a5ce5c84dc5bead730a4b49d0698b4aaef4bc06ce164...text/plainalbert_einstein.txtEinstein AssociationNaNNaNNaN
241https://sandbox.bluebrainnexus.io/v1/resources...AssociationPersonDataDownloadLocationhttps://bluebrain.github.io/nexus/vocabulary/d......DiskStorage1.0bytes50.0https://sandbox.bluebrainnexus.io/v1/files/git...SHA-256text/plainalbert_einstein.txtEinstein AssociationNaNNaNNaN
25https://sandbox.bluebrainnexus.io/v1/resources...AssociationPersonhttp://purl.obolibrary.org/obo/PATO_0000383LabeledOntologyEntityfemaleMarie CurieDataDownloadLocationhttps://bluebrain.github.io/nexus/vocabulary/d......46.0https://sandbox.bluebrainnexus.io/v1/files/git...SHA-256e0fe65f725bf28fe2b88c7bafb51fb5ef1df0ab14c68a3...text/plainmarie_curie.txtCurie AssociationNaNNaNNaN
262https://sandbox.bluebrainnexus.io/v1/resources...AssociationPersonNaNNaNNaNJane DoeNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaN[{'type': 'DataDownload', 'atLocation': {'type...NaNNaN
27https://sandbox.bluebrainnexus.io/v1/resources...AssociationPersonNaNNaNJohn SmithNaNJane DoeNaNNaNNaN...NaNNaNNaNNaNNaNNaN[{'type': 'DataDownload', 'atLocation': {'type...NaNNaN
\n", - "

28 rows × 23 columns

\n", "
" ], "text/plain": [ - " id type agent.type \\\n", - "0 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", - "1 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", - "2 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", - "3 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", - "4 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", - "5 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", - "6 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", - "7 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", - "8 https://sandbox.bluebrainnexus.io/v1/resources... Association NaN \n", - "9 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", - "10 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", - "11 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", - "12 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", - "13 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", - "14 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", - "15 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", - "16 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", - "17 https://sandbox.bluebrainnexus.io/v1/resources... Association NaN \n", - "18 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", - "19 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", - "20 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", - "21 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", - "22 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", - "23 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", - "24 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", - "25 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", - "26 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", - "27 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", - "\n", - " agent.gender.id agent.gender.type \\\n", - "0 http://purl.obolibrary.org/obo/PATO_0000384 LabeledOntologyEntity \n", - "1 http://purl.obolibrary.org/obo/PATO_0000383 LabeledOntologyEntity \n", - "2 NaN NaN \n", - "3 NaN NaN \n", - "4 NaN NaN \n", - "5 NaN NaN \n", - "6 NaN NaN \n", - "7 NaN NaN \n", - "8 NaN NaN \n", - "9 http://purl.obolibrary.org/obo/PATO_0000383 LabeledOntologyEntity \n", - "10 http://purl.obolibrary.org/obo/PATO_0000384 LabeledOntologyEntity \n", - "11 NaN NaN \n", - "12 NaN NaN \n", - "13 NaN NaN \n", - "14 NaN NaN \n", - "15 NaN NaN \n", - "16 NaN NaN \n", - "17 NaN NaN \n", - "18 NaN NaN \n", - "19 NaN NaN \n", - "20 NaN NaN \n", - "21 NaN NaN \n", - "22 http://purl.obolibrary.org/obo/PATO_0000383 LabeledOntologyEntity \n", - "23 http://purl.obolibrary.org/obo/PATO_0000384 LabeledOntologyEntity \n", - "24 http://purl.obolibrary.org/obo/PATO_0000384 LabeledOntologyEntity \n", - "25 http://purl.obolibrary.org/obo/PATO_0000383 LabeledOntologyEntity \n", - "26 NaN NaN \n", - "27 NaN NaN \n", - "\n", - " agent.gender.label agent.name distribution.type \\\n", - "0 male Albert Einstein DataDownload \n", - "1 female Marie Curie DataDownload \n", - "2 NaN Jane Doe NaN \n", - "3 NaN John Smith NaN \n", - "4 NaN Jane Doe NaN \n", - "5 NaN John Smith NaN \n", - "6 NaN Jane Doe NaN \n", - "7 NaN Jane Doe NaN \n", - "8 NaN NaN NaN \n", - "9 female Marie Curie DataDownload \n", - "10 male Albert Einstein DataDownload \n", - "11 NaN Jane Doe NaN \n", - "12 NaN John Smith NaN \n", - "13 NaN Jane Doe NaN \n", - "14 NaN Jane Doe NaN \n", - "15 NaN Jane Doe NaN \n", - "16 NaN Jane Doe NaN \n", - "17 NaN NaN NaN \n", - "18 NaN Jane Doe NaN \n", - "19 NaN Jane Doe NaN \n", - "20 NaN Jane Doe NaN \n", - "21 NaN Jane Doe NaN \n", - "22 female Marie Curie DataDownload \n", - "23 male Albert Einstein DataDownload \n", - "24 male Albert Einstein DataDownload \n", - "25 female Marie Curie DataDownload \n", - "26 NaN Jane Doe NaN \n", - "27 NaN Jane Doe NaN \n", - "\n", - " distribution.atLocation.type \\\n", - "0 Location \n", - "1 Location \n", - "2 NaN \n", - "3 NaN \n", - "4 NaN \n", - "5 NaN \n", - "6 NaN \n", - "7 NaN \n", - "8 NaN \n", - "9 Location \n", - "10 Location \n", - "11 NaN \n", - "12 NaN \n", - "13 NaN \n", - "14 NaN \n", - "15 NaN \n", - "16 NaN \n", - "17 NaN \n", - "18 NaN \n", - "19 NaN \n", - "20 NaN \n", - "21 NaN \n", - "22 Location \n", - "23 Location \n", - "24 Location \n", - "25 Location \n", - "26 NaN \n", - "27 NaN \n", + " id type agent.type \\\n", + "0 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", + "1 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", + "2 https://sandbox.bluebrainnexus.io/v1/resources... Association Person \n", "\n", - " distribution.atLocation.store.id ... \\\n", - "0 https://bluebrain.github.io/nexus/vocabulary/d... ... \n", - "1 https://bluebrain.github.io/nexus/vocabulary/d... ... \n", - "2 NaN ... \n", - "3 NaN ... \n", - "4 NaN ... \n", - "5 NaN ... \n", - "6 NaN ... \n", - "7 NaN ... \n", - "8 NaN ... \n", - "9 https://bluebrain.github.io/nexus/vocabulary/d... ... \n", - "10 https://bluebrain.github.io/nexus/vocabulary/d... ... \n", - "11 NaN ... \n", - "12 NaN ... \n", - "13 NaN ... \n", - "14 NaN ... \n", - "15 NaN ... \n", - "16 NaN ... \n", - "17 NaN ... \n", - "18 NaN ... \n", - "19 NaN ... \n", - "20 NaN ... \n", - "21 NaN ... \n", - "22 https://bluebrain.github.io/nexus/vocabulary/d... ... \n", - "23 https://bluebrain.github.io/nexus/vocabulary/d... ... \n", - "24 https://bluebrain.github.io/nexus/vocabulary/d... ... \n", - "25 https://bluebrain.github.io/nexus/vocabulary/d... ... \n", - "26 NaN ... \n", - "27 NaN ... \n", + " agent.gender.id agent.gender.type \\\n", + "0 http://purl.obolibrary.org/obo/PATO_0000383 LabeledOntologyEntity \n", + "1 http://purl.obolibrary.org/obo/PATO_0000384 LabeledOntologyEntity \n", + "2 NaN NaN \n", "\n", - " distribution.contentSize.value \\\n", - "0 50.0 \n", - "1 46.0 \n", - "2 NaN \n", - "3 NaN \n", - "4 NaN \n", - "5 NaN \n", - "6 NaN \n", - "7 NaN \n", - "8 NaN \n", - "9 46.0 \n", - "10 50.0 \n", - "11 NaN \n", - "12 NaN \n", - "13 NaN \n", - "14 NaN \n", - "15 NaN \n", - "16 NaN \n", - "17 NaN \n", - "18 NaN \n", - "19 NaN \n", - "20 NaN \n", - "21 NaN \n", - "22 46.0 \n", - "23 50.0 \n", - "24 50.0 \n", - "25 46.0 \n", - "26 NaN \n", - "27 NaN \n", + " agent.gender.label agent.name distribution.type \\\n", + "0 female Marie Curie DataDownload \n", + "1 male Albert Einstein DataDownload \n", + "2 NaN John Smith NaN \n", "\n", - " distribution.contentUrl \\\n", - "0 https://sandbox.bluebrainnexus.io/v1/files/git... \n", - "1 https://sandbox.bluebrainnexus.io/v1/files/git... \n", - "2 NaN \n", - "3 NaN \n", - "4 NaN \n", - "5 NaN \n", - "6 NaN \n", - "7 NaN \n", - "8 NaN \n", - "9 https://sandbox.bluebrainnexus.io/v1/files/git... \n", - "10 https://sandbox.bluebrainnexus.io/v1/files/git... \n", - "11 NaN \n", - "12 NaN \n", - "13 NaN \n", - "14 NaN \n", - "15 NaN \n", - "16 NaN \n", - "17 NaN \n", - "18 NaN \n", - "19 NaN \n", - "20 NaN \n", - "21 NaN \n", - "22 https://sandbox.bluebrainnexus.io/v1/files/git... \n", - "23 https://sandbox.bluebrainnexus.io/v1/files/git... \n", - "24 https://sandbox.bluebrainnexus.io/v1/files/git... \n", - "25 https://sandbox.bluebrainnexus.io/v1/files/git... \n", - "26 NaN \n", - "27 NaN \n", + " distribution.atLocation.type \\\n", + "0 Location \n", + "1 Location \n", + "2 NaN \n", "\n", - " distribution.digest.algorithm \\\n", - "0 SHA-256 \n", - "1 SHA-256 \n", - "2 NaN \n", - "3 NaN \n", - "4 NaN \n", - "5 NaN \n", - "6 NaN \n", - "7 NaN \n", - "8 NaN \n", - "9 SHA-256 \n", - "10 SHA-256 \n", - "11 NaN \n", - "12 NaN \n", - "13 NaN \n", - "14 NaN \n", - "15 NaN \n", - "16 NaN \n", - "17 NaN \n", - "18 NaN \n", - "19 NaN \n", - "20 NaN \n", - "21 NaN \n", - "22 SHA-256 \n", - "23 SHA-256 \n", - "24 SHA-256 \n", - "25 SHA-256 \n", - "26 NaN \n", - "27 NaN \n", + " distribution.atLocation.store.id \\\n", + "0 https://bluebrain.github.io/nexus/vocabulary/d... \n", + "1 https://bluebrain.github.io/nexus/vocabulary/d... \n", + "2 NaN \n", "\n", - " distribution.digest.value \\\n", - "0 91a5ce5c84dc5bead730a4b49d0698b4aaef4bc06ce164... \n", - "1 e0fe65f725bf28fe2b88c7bafb51fb5ef1df0ab14c68a3... \n", - "2 NaN \n", - "3 NaN \n", - "4 NaN \n", - "5 NaN \n", - "6 NaN \n", - "7 NaN \n", - "8 NaN \n", - "9 e0fe65f725bf28fe2b88c7bafb51fb5ef1df0ab14c68a3... \n", - "10 91a5ce5c84dc5bead730a4b49d0698b4aaef4bc06ce164... \n", - "11 NaN \n", - "12 NaN \n", - "13 NaN \n", - "14 NaN \n", - "15 NaN \n", - "16 NaN \n", - "17 NaN \n", - "18 NaN \n", - "19 NaN \n", - "20 NaN \n", - "21 NaN \n", - "22 e0fe65f725bf28fe2b88c7bafb51fb5ef1df0ab14c68a3... \n", - "23 91a5ce5c84dc5bead730a4b49d0698b4aaef4bc06ce164... \n", - "24 91a5ce5c84dc5bead730a4b49d0698b4aaef4bc06ce164... \n", - "25 e0fe65f725bf28fe2b88c7bafb51fb5ef1df0ab14c68a3... \n", - "26 NaN \n", - "27 NaN \n", + " distribution.atLocation.store.type distribution.atLocation.store._rev \\\n", + "0 DiskStorage 1.0 \n", + "1 DiskStorage 1.0 \n", + "2 NaN NaN \n", "\n", - " distribution.encodingFormat distribution.name name \\\n", - "0 text/plain albert_einstein.txt Einstein Association \n", - "1 text/plain marie_curie.txt Curie Association \n", - "2 NaN NaN NaN \n", - "3 NaN NaN NaN \n", - "4 NaN NaN NaN \n", - "5 NaN NaN NaN \n", - "6 NaN NaN NaN \n", - "7 NaN NaN NaN \n", - "8 NaN NaN NaN \n", - "9 text/plain marie_curie.txt Curie Association \n", - "10 text/plain albert_einstein.txt Einstein Association \n", - "11 NaN NaN NaN \n", - "12 NaN NaN NaN \n", - "13 NaN NaN NaN \n", - "14 NaN NaN NaN \n", - "15 NaN NaN NaN \n", - "16 NaN NaN NaN \n", - "17 NaN NaN NaN \n", - "18 NaN NaN NaN \n", - "19 NaN NaN NaN \n", - "20 NaN NaN NaN \n", - "21 NaN NaN NaN \n", - "22 text/plain marie_curie.txt Curie Association \n", - "23 text/plain albert_einstein.txt Einstein Association \n", - "24 text/plain albert_einstein.txt Einstein Association \n", - "25 text/plain marie_curie.txt Curie Association \n", - "26 NaN NaN NaN \n", - "27 NaN NaN NaN \n", + " distribution.contentSize.unitCode distribution.contentSize.value \\\n", + "0 bytes 46.0 \n", + "1 bytes 50.0 \n", + "2 NaN NaN \n", "\n", - " distribution \\\n", - "0 NaN \n", - "1 NaN \n", - "2 NaN \n", - "3 NaN \n", - "4 NaN \n", - "5 NaN \n", - "6 [{'type': 'DataDownload', 'atLocation': {'type... \n", - "7 NaN \n", - "8 NaN \n", - "9 NaN \n", - "10 NaN \n", - "11 NaN \n", - "12 NaN \n", - "13 [{'type': 'DataDownload', 'atLocation': {'type... \n", - "14 [{'type': 'DataDownload', 'atLocation': {'type... \n", - "15 [{'type': 'DataDownload', 'atLocation': {'type... \n", - "16 NaN \n", - "17 NaN \n", - "18 [{'type': 'DataDownload', 'atLocation': {'type... \n", - "19 [{'type': 'DataDownload', 'atLocation': {'type... \n", - "20 [{'type': 'DataDownload', 'atLocation': {'type... \n", - "21 [{'type': 'DataDownload', 'atLocation': {'type... \n", - "22 NaN \n", - "23 NaN \n", - "24 NaN \n", - "25 NaN \n", - "26 [{'type': 'DataDownload', 'atLocation': {'type... \n", - "27 [{'type': 'DataDownload', 'atLocation': {'type... \n", + " distribution.contentUrl \\\n", + "0 https://sandbox.bluebrainnexus.io/v1/files/git... \n", + "1 https://sandbox.bluebrainnexus.io/v1/files/git... \n", + "2 NaN \n", "\n", - " agent.id \\\n", - "0 NaN \n", - "1 NaN \n", - "2 NaN \n", - "3 NaN \n", - "4 NaN \n", - "5 NaN \n", - "6 NaN \n", - "7 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "8 NaN \n", - "9 NaN \n", - "10 NaN \n", - "11 NaN \n", - "12 NaN \n", - "13 NaN \n", - "14 NaN \n", - "15 NaN \n", - "16 https://sandbox.bluebrainnexus.io/v1/resources... \n", - "17 NaN \n", - "18 NaN \n", - "19 NaN \n", - "20 NaN \n", - "21 NaN \n", - "22 NaN \n", - "23 NaN \n", - "24 NaN \n", - "25 NaN \n", - "26 NaN \n", - "27 NaN \n", + " distribution.digest.algorithm \\\n", + "0 SHA-256 \n", + "1 SHA-256 \n", + "2 NaN \n", "\n", - " agent \n", - "0 NaN \n", - "1 NaN \n", - "2 NaN \n", - "3 NaN \n", - "4 NaN \n", - "5 NaN \n", - "6 NaN \n", - "7 NaN \n", - "8 [{'id': 'https://sandbox.bluebrainnexus.io/v1/... \n", - "9 NaN \n", - "10 NaN \n", - "11 NaN \n", - "12 NaN \n", - "13 NaN \n", - "14 NaN \n", - "15 NaN \n", - "16 NaN \n", - "17 [{'id': 'https://sandbox.bluebrainnexus.io/v1/... \n", - "18 NaN \n", - "19 NaN \n", - "20 NaN \n", - "21 NaN \n", - "22 NaN \n", - "23 NaN \n", - "24 NaN \n", - "25 NaN \n", - "26 NaN \n", - "27 NaN \n", + " distribution.digest.value \\\n", + "0 e0fe65f725bf28fe2b88c7bafb51fb5ef1df0ab14c68a3... \n", + "1 91a5ce5c84dc5bead730a4b49d0698b4aaef4bc06ce164... \n", + "2 NaN \n", "\n", - "[28 rows x 23 columns]" + " distribution.encodingFormat distribution.name name \n", + "0 text/plain marie_curie.txt Curie Association \n", + "1 text/plain albert_einstein.txt Einstein Association \n", + "2 NaN NaN NaN " ] }, - "execution_count": 81, + "execution_count": 87, "metadata": {}, "output_type": "execute_result" } @@ -6917,6 +3082,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -6930,6 +3096,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -6937,6 +3104,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -6945,7 +3113,7 @@ }, { "cell_type": "code", - "execution_count": 82, + "execution_count": 88, "metadata": {}, "outputs": [], "source": [ @@ -6955,7 +3123,7 @@ }, { "cell_type": "code", - "execution_count": 83, + "execution_count": 89, "metadata": {}, "outputs": [], "source": [ @@ -6965,7 +3133,7 @@ }, { "cell_type": "code", - "execution_count": 84, + "execution_count": 90, "metadata": {}, "outputs": [], "source": [ @@ -6974,7 +3142,7 @@ }, { "cell_type": "code", - "execution_count": 85, + "execution_count": 91, "metadata": {}, "outputs": [ { @@ -6992,7 +3160,7 @@ }, { "cell_type": "code", - "execution_count": 86, + "execution_count": 92, "metadata": { "scrolled": true }, @@ -7104,7 +3272,11 @@ " contentSize:\n", " {\n", " unitCode: \"\"\n", - " value: \"\"\n", + " value:\n", + " [\n", + " 0.0\n", + " 0\n", + " ]\n", " }\n", " digest:\n", " {\n", @@ -7135,6 +3307,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -7145,7 +3318,7 @@ }, { "cell_type": "code", - "execution_count": 87, + "execution_count": 93, "metadata": {}, "outputs": [], "source": [ @@ -7161,7 +3334,7 @@ }, { "cell_type": "code", - "execution_count": 88, + "execution_count": 94, "metadata": {}, "outputs": [], "source": [ @@ -7170,7 +3343,7 @@ }, { "cell_type": "code", - "execution_count": 89, + "execution_count": 95, "metadata": {}, "outputs": [ { @@ -7179,7 +3352,7 @@ "list" ] }, - "execution_count": 89, + "execution_count": 95, "metadata": {}, "output_type": "execute_result" } @@ -7190,16 +3363,16 @@ }, { "cell_type": "code", - "execution_count": 90, + "execution_count": 96, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "82" + "3" ] }, - "execution_count": 90, + "execution_count": 96, "metadata": {}, "output_type": "execute_result" } @@ -7210,7 +3383,7 @@ }, { "cell_type": "code", - "execution_count": 91, + "execution_count": 97, "metadata": {}, "outputs": [ { @@ -7218,8 +3391,8 @@ "output_type": "stream", "text": [ "{\n", - " id: https://sandbox.bluebrainnexus.io/v1/resources/github-users/crisely09/_/c2f62d9e-d1ea-4baa-92e2-2bb96d9f9d6d\n", - " contributor: t3914\n", + " id: https://sandbox.bluebrainnexus.io/v1/resources/github-users/crisely09/_/40162355-af23-44a9-9c9a-36b6a4d35dcf\n", + " contributor: t3318\n", " name: Jane Doe\n", "}\n" ] @@ -7231,7 +3404,7 @@ }, { "cell_type": "code", - "execution_count": 92, + "execution_count": 98, "metadata": {}, "outputs": [ { @@ -7264,92 +3437,33 @@ " \n", " 0\n", " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " t3914\n", + " t3318\n", " Jane Doe\n", " \n", " \n", " 1\n", " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " t3918\n", - " Jane Doe\n", - " \n", - " \n", - " 2\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " t3920\n", - " John Smith\n", - " \n", - " \n", - " 3\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " t4013\n", - " Jane Doe\n", - " \n", - " \n", - " 4\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " t4015\n", - " John Smith\n", - " \n", - " \n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " \n", - " \n", - " 77\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " t3880\n", - " Jane Doe\n", - " \n", - " \n", - " 78\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " t3882\n", + " t3319\n", " John Smith\n", " \n", " \n", - " 79\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " t3901\n", - " John Smith\n", - " \n", - " \n", - " 80\n", + " 2\n", " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " t3903\n", + " t3325\n", " Jane Doe\n", " \n", - " \n", - " 81\n", - " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " t3911\n", - " John Smith\n", - " \n", " \n", "\n", - "

82 rows × 3 columns

\n", "" ], "text/plain": [ - " id contributor name\n", - "0 https://sandbox.bluebrainnexus.io/v1/resources... t3914 Jane Doe\n", - "1 https://sandbox.bluebrainnexus.io/v1/resources... t3918 Jane Doe\n", - "2 https://sandbox.bluebrainnexus.io/v1/resources... t3920 John Smith\n", - "3 https://sandbox.bluebrainnexus.io/v1/resources... t4013 Jane Doe\n", - "4 https://sandbox.bluebrainnexus.io/v1/resources... t4015 John Smith\n", - ".. ... ... ...\n", - "77 https://sandbox.bluebrainnexus.io/v1/resources... t3880 Jane Doe\n", - "78 https://sandbox.bluebrainnexus.io/v1/resources... t3882 John Smith\n", - "79 https://sandbox.bluebrainnexus.io/v1/resources... t3901 John Smith\n", - "80 https://sandbox.bluebrainnexus.io/v1/resources... t3903 Jane Doe\n", - "81 https://sandbox.bluebrainnexus.io/v1/resources... t3911 John Smith\n", - "\n", - "[82 rows x 3 columns]" + " id contributor name\n", + "0 https://sandbox.bluebrainnexus.io/v1/resources... t3318 Jane Doe\n", + "1 https://sandbox.bluebrainnexus.io/v1/resources... t3319 John Smith\n", + "2 https://sandbox.bluebrainnexus.io/v1/resources... t3325 Jane Doe" ] }, - "execution_count": 92, + "execution_count": 98, "metadata": {}, "output_type": "execute_result" } @@ -7359,6 +3473,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -7367,7 +3482,7 @@ }, { "cell_type": "code", - "execution_count": 93, + "execution_count": 99, "metadata": {}, "outputs": [ { @@ -7399,6 +3514,7 @@ " nsg:contribution/prov:agent ?contributor.\n", " ?contributor schema:name ?name.\n", " }\n", + " LIMIT 3\n", "\n" ] } @@ -7408,6 +3524,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -7418,7 +3535,7 @@ }, { "cell_type": "code", - "execution_count": 94, + "execution_count": 100, "metadata": {}, "outputs": [], "source": [ @@ -7454,7 +3571,7 @@ }, { "cell_type": "code", - "execution_count": 95, + "execution_count": 101, "metadata": {}, "outputs": [ { @@ -7500,7 +3617,7 @@ }, { "cell_type": "code", - "execution_count": 96, + "execution_count": 102, "metadata": {}, "outputs": [ { @@ -7509,7 +3626,7 @@ "list" ] }, - "execution_count": 96, + "execution_count": 102, "metadata": {}, "output_type": "execute_result" } @@ -7520,7 +3637,7 @@ }, { "cell_type": "code", - "execution_count": 97, + "execution_count": 103, "metadata": {}, "outputs": [ { @@ -7529,7 +3646,7 @@ "3" ] }, - "execution_count": 97, + "execution_count": 103, "metadata": {}, "output_type": "execute_result" } @@ -7540,7 +3657,7 @@ }, { "cell_type": "code", - "execution_count": 98, + "execution_count": 104, "metadata": {}, "outputs": [ { @@ -7549,7 +3666,7 @@ "kgforge.core.resource.Resource" ] }, - "execution_count": 98, + "execution_count": 104, "metadata": {}, "output_type": "execute_result" } @@ -7560,7 +3677,7 @@ }, { "cell_type": "code", - "execution_count": 99, + "execution_count": 105, "metadata": {}, "outputs": [ { @@ -7592,17 +3709,17 @@ " \n", " 0\n", " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " Jane Doe\n", + " John Smith\n", " \n", " \n", " 1\n", " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " Jane Doe\n", + " John Smith\n", " \n", " \n", " 2\n", " https://sandbox.bluebrainnexus.io/v1/resources...\n", - " John Smith\n", + " Jane Doe\n", " \n", " \n", "\n", @@ -7610,12 +3727,12 @@ ], "text/plain": [ " id name\n", - "0 https://sandbox.bluebrainnexus.io/v1/resources... Jane Doe\n", - "1 https://sandbox.bluebrainnexus.io/v1/resources... Jane Doe\n", - "2 https://sandbox.bluebrainnexus.io/v1/resources... John Smith" + "0 https://sandbox.bluebrainnexus.io/v1/resources... John Smith\n", + "1 https://sandbox.bluebrainnexus.io/v1/resources... John Smith\n", + "2 https://sandbox.bluebrainnexus.io/v1/resources... Jane Doe" ] }, - "execution_count": 99, + "execution_count": 105, "metadata": {}, "output_type": "execute_result" } @@ -7642,7 +3759,7 @@ }, { "cell_type": "code", - "execution_count": 100, + "execution_count": 106, "metadata": {}, "outputs": [], "source": [ @@ -7676,7 +3793,7 @@ }, { "cell_type": "code", - "execution_count": 101, + "execution_count": 107, "metadata": {}, "outputs": [ { @@ -7720,16 +3837,16 @@ }, { "cell_type": "code", - "execution_count": 102, + "execution_count": 108, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "84" + "100" ] }, - "execution_count": 102, + "execution_count": 108, "metadata": {}, "output_type": "execute_result" } @@ -7748,7 +3865,7 @@ }, { "cell_type": "code", - "execution_count": 103, + "execution_count": 109, "metadata": {}, "outputs": [], "source": [ @@ -7764,7 +3881,7 @@ }, { "cell_type": "code", - "execution_count": 104, + "execution_count": 110, "metadata": {}, "outputs": [ { @@ -7806,16 +3923,16 @@ }, { "cell_type": "code", - "execution_count": 105, + "execution_count": 111, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "84" + "100" ] }, - "execution_count": 105, + "execution_count": 111, "metadata": {}, "output_type": "execute_result" } @@ -7825,6 +3942,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -7834,6 +3952,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -7842,7 +3961,7 @@ }, { "cell_type": "code", - "execution_count": 106, + "execution_count": 112, "metadata": {}, "outputs": [], "source": [ @@ -7852,7 +3971,7 @@ }, { "cell_type": "code", - "execution_count": 107, + "execution_count": 113, "metadata": {}, "outputs": [], "source": [ @@ -7862,7 +3981,7 @@ }, { "cell_type": "code", - "execution_count": 108, + "execution_count": 114, "metadata": {}, "outputs": [], "source": [ @@ -7871,7 +3990,7 @@ }, { "cell_type": "code", - "execution_count": 109, + "execution_count": 115, "metadata": {}, "outputs": [ { @@ -7888,6 +4007,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -7896,7 +4016,7 @@ }, { "cell_type": "code", - "execution_count": 110, + "execution_count": 116, "metadata": {}, "outputs": [], "source": [ @@ -7919,7 +4039,7 @@ }, { "cell_type": "code", - "execution_count": 111, + "execution_count": 117, "metadata": {}, "outputs": [], "source": [ @@ -7929,7 +4049,7 @@ }, { "cell_type": "code", - "execution_count": 112, + "execution_count": 118, "metadata": {}, "outputs": [ { @@ -7938,7 +4058,7 @@ "list" ] }, - "execution_count": 112, + "execution_count": 118, "metadata": {}, "output_type": "execute_result" } @@ -7949,7 +4069,7 @@ }, { "cell_type": "code", - "execution_count": 113, + "execution_count": 119, "metadata": {}, "outputs": [ { @@ -7958,7 +4078,7 @@ "3" ] }, - "execution_count": 113, + "execution_count": 119, "metadata": {}, "output_type": "execute_result" } @@ -7969,7 +4089,7 @@ }, { "cell_type": "code", - "execution_count": 114, + "execution_count": 120, "metadata": {}, "outputs": [ { @@ -7978,7 +4098,7 @@ "kgforge.core.resource.Resource" ] }, - "execution_count": 114, + "execution_count": 120, "metadata": {}, "output_type": "execute_result" } @@ -7989,7 +4109,7 @@ }, { "cell_type": "code", - "execution_count": 115, + "execution_count": 121, "metadata": {}, "outputs": [ { @@ -8020,36 +4140,31 @@ " \n", " \n", " 0\n", - " https://bbp.epfl.ch/neurosciencegraph/data/neu...\n", - " Cux2-CreERT2;Ai14-205530.03.02.01\n", + " https://sandbox.bluebrainnexus.io/v1/resources...\n", + " Interesting associations\n", " \n", " \n", " 1\n", - " https://bbp.epfl.ch/neurosciencegraph/data/neu...\n", - " Cux2-CreERT2;Ai14-205530.03.02.01\n", + " https://sandbox.bluebrainnexus.io/v1/resources...\n", + " Interesting people\n", " \n", " \n", " 2\n", - " https://bbp.epfl.ch/neurosciencegraph/data/neu...\n", - " Cux2-CreERT2;Ai14-205530.03.02.01\n", + " https://sandbox.bluebrainnexus.io/v1/resources...\n", + " Interesting people\n", " \n", " \n", "\n", "" ], "text/plain": [ - " id \\\n", - "0 https://bbp.epfl.ch/neurosciencegraph/data/neu... \n", - "1 https://bbp.epfl.ch/neurosciencegraph/data/neu... \n", - "2 https://bbp.epfl.ch/neurosciencegraph/data/neu... \n", - "\n", - " name \n", - "0 Cux2-CreERT2;Ai14-205530.03.02.01 \n", - "1 Cux2-CreERT2;Ai14-205530.03.02.01 \n", - "2 Cux2-CreERT2;Ai14-205530.03.02.01 " + " id name\n", + "0 https://sandbox.bluebrainnexus.io/v1/resources... Interesting associations\n", + "1 https://sandbox.bluebrainnexus.io/v1/resources... Interesting people\n", + "2 https://sandbox.bluebrainnexus.io/v1/resources... Interesting people" ] }, - "execution_count": 115, + "execution_count": 121, "metadata": {}, "output_type": "execute_result" } @@ -8059,6 +4174,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -8066,6 +4182,7 @@ ] }, { + "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ @@ -8074,7 +4191,7 @@ }, { "cell_type": "code", - "execution_count": 116, + "execution_count": 122, "metadata": {}, "outputs": [], "source": [ @@ -8083,7 +4200,7 @@ }, { "cell_type": "code", - "execution_count": 117, + "execution_count": 123, "metadata": {}, "outputs": [ { @@ -8105,7 +4222,7 @@ }, { "cell_type": "code", - "execution_count": 118, + "execution_count": 124, "metadata": {}, "outputs": [], "source": [ @@ -8114,7 +4231,7 @@ }, { "cell_type": "code", - "execution_count": 119, + "execution_count": 125, "metadata": {}, "outputs": [], "source": [ @@ -8123,7 +4240,7 @@ }, { "cell_type": "code", - "execution_count": 120, + "execution_count": 126, "metadata": {}, "outputs": [ { @@ -8141,7 +4258,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 127, "metadata": {}, "outputs": [], "source": [ @@ -8156,7 +4273,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 128, "metadata": {}, "outputs": [], "source": [ @@ -8166,7 +4283,7 @@ }, { "cell_type": "code", - "execution_count": 195, + "execution_count": 129, "metadata": {}, "outputs": [], "source": [ @@ -8177,32 +4294,26 @@ }, { "cell_type": "code", - "execution_count": 122, + "execution_count": 130, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "total 1344\n", - "-rw-r--r-- 1 cgonzale 10067 477 Jan 18 13:17 associations.tsv\n", - "-rw-r--r-- 1 cgonzale 10067 477 Jan 25 14:24 associations.tsv.20230125142439\n", - "-rw-r--r-- 1 cgonzale 10067 477 Jan 25 14:34 associations.tsv.20230125143400\n", - "-rw-r--r-- 1 cgonzale 10067 16 Jan 18 13:17 my_data.xwz\n", - "-rw-r--r-- 1 cgonzale 10067 16 Jan 25 14:24 my_data.xwz.20230125142439\n", - "-rw-r--r-- 1 cgonzale 10067 16 Jan 25 14:34 my_data.xwz.20230125143400\n", - "-rw-r--r-- 1 cgonzale 10067 24 Jan 18 13:17 my_data_derived.txt\n", - "-rw-r--r-- 1 cgonzale 10067 24 Jan 25 14:24 my_data_derived.txt.20230125142439\n", - "-rw-r--r-- 1 cgonzale 10067 24 Jan 25 14:34 my_data_derived.txt.20230125143400\n", - "-rw-r--r-- 1 cgonzale 10067 126 Jan 18 13:17 persons-with-id.csv\n", - "-rw-r--r-- 1 cgonzale 10067 126 Jan 25 14:24 persons-with-id.csv.20230125142439\n", - "-rw-r--r-- 1 cgonzale 10067 126 Jan 25 14:34 persons-with-id.csv.20230125143400\n", - "-rw-r--r-- 1 cgonzale 10067 52 Jan 18 13:17 persons.csv\n", - "-rw-r--r-- 1 cgonzale 10067 52 Jan 25 14:24 persons.csv.20230125142439\n", - "-rw-r--r-- 1 cgonzale 10067 52 Jan 25 14:34 persons.csv.20230125143400\n", - "-rw-r--r-- 1 cgonzale 10067 204848 Jan 18 13:17 tfidfvectorizer_model_schemaorg_linking\n", - "-rw-r--r-- 1 cgonzale 10067 204848 Jan 25 14:24 tfidfvectorizer_model_schemaorg_linking.20230125142439\n", - "-rw-r--r-- 1 cgonzale 10067 204848 Jan 25 14:34 tfidfvectorizer_model_schemaorg_linking.20230125143400\n" + "total 896\n", + "-rw-r--r-- 1 cgonzale 10067 477 May 22 10:24 associations.tsv\n", + "-rw-r--r-- 1 cgonzale 10067 477 May 22 10:58 associations.tsv.20230522105817\n", + "-rw-r--r-- 1 cgonzale 10067 16 May 22 10:24 my_data.xwz\n", + "-rw-r--r-- 1 cgonzale 10067 16 May 22 10:58 my_data.xwz.20230522105817\n", + "-rw-r--r-- 1 cgonzale 10067 24 May 22 10:24 my_data_derived.txt\n", + "-rw-r--r-- 1 cgonzale 10067 24 May 22 10:58 my_data_derived.txt.20230522105817\n", + "-rw-r--r-- 1 cgonzale 10067 126 May 22 10:24 persons-with-id.csv\n", + "-rw-r--r-- 1 cgonzale 10067 126 May 22 10:58 persons-with-id.csv.20230522105817\n", + "-rw-r--r-- 1 cgonzale 10067 52 May 22 10:24 persons.csv\n", + "-rw-r--r-- 1 cgonzale 10067 52 May 22 10:58 persons.csv.20230522105817\n", + "-rw-r--r-- 1 cgonzale 10067 204848 May 22 10:24 tfidfvectorizer_model_schemaorg_linking\n", + "-rw-r--r-- 1 cgonzale 10067 204848 May 22 10:58 tfidfvectorizer_model_schemaorg_linking.20230522105817\n" ] } ], @@ -8212,7 +4323,7 @@ }, { "cell_type": "code", - "execution_count": 123, + "execution_count": 131, "metadata": {}, "outputs": [], "source": [ @@ -8236,7 +4347,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.13" + "version": "3.8.16" }, "vscode": { "interpreter": { diff --git a/kgentitylinkingsklearn/entity_linking_sklearn.py b/kgentitylinkingsklearn/entity_linking_sklearn.py index 22bb526f..4d15a3e3 100644 --- a/kgentitylinkingsklearn/entity_linking_sklearn.py +++ b/kgentitylinkingsklearn/entity_linking_sklearn.py @@ -38,7 +38,7 @@ def mapper(self) -> Callable: @staticmethod def _service_from_directory(dirpath: Path, targets: Dict[str, Tuple[str, Dict[str, str]]], **source_config) -> Dict[str, LazyAction]: # FIXME: the same model is loaded multiple times if provided for multiple targets - return {target: LazyAction(EntityLinkerServiceSkLearn.from_pretrained, dirpath, filename_filter[0]) for target, filename_filter in + return {target: LazyAction(EntityLinkerServiceSkLearn.from_pretrained, dirpath, filename_filter) for target, filename_filter in targets.items()} def _is_target_valid(self, target: str) -> Optional[bool]: diff --git a/kgforge/specializations/stores/bluebrain_nexus.py b/kgforge/specializations/stores/bluebrain_nexus.py index 5fdbd4d1..9b0913ae 100644 --- a/kgforge/specializations/stores/bluebrain_nexus.py +++ b/kgforge/specializations/stores/bluebrain_nexus.py @@ -66,6 +66,7 @@ from kgforge.specializations.mappings import DictionaryMapping from kgforge.specializations.stores.nexus.service import BatchAction, Service + class CategoryDataType(Enum): DATETIME = "datetime" NUMBER = "number" @@ -351,21 +352,42 @@ def retrieve( url, params=query_params, headers=self.service.headers ) response.raise_for_status() + except HTTPError as er: + if cross_bucket: + nexus_path = f"{self.service.endpoint}/resources/" + else: + nexus_path = self.service.url_resources + # Try to use the id as it was given + if id.startswith(nexus_path): + url_resource = id_without_query + if retrieve_source and not cross_bucket: + url = "/".join((id_without_query, "source")) + else: + url = id_without_query + try: + response = requests.get( + url, params=query_params, headers=self.service.headers + ) + response.raise_for_status() + except HTTPError as e: + raise RetrievalError(_error_message(e)) + else: + raise RetrievalError(_error_message(er)) + finally: if retrieve_source and not cross_bucket: response_metadata = requests.get( url_resource, params=query_params, headers=self.service.headers ) response_metadata.raise_for_status() - if retrieve_source and cross_bucket: + elif retrieve_source and cross_bucket and response and ('_self' in response.json()): response_metadata = requests.get( "/".join([response.json()["_self"], "source"]), params=query_params, headers=self.service.headers ) response_metadata.raise_for_status() - - except HTTPError as e: - raise RetrievalError(_error_message(e)) - else: + else: + response_metadata = True # when retrieve_source is False + if response and response_metadata: try: data = response.json() resource = self.service.to_resource(data) @@ -692,7 +714,8 @@ def search( f"search_endpoint values are: '{self.service.sparql_endpoint['type'], self.service.elastic_endpoint['type']}'" ) if "filters" in params: - raise ValueError("A 'filters' key was provided as params. Filters should be provided as iterable to be unpacked.") + raise ValueError( + "A 'filters' key was provided as params. Filters should be provided as iterable to be unpacked.") if bucket and not cross_bucket: not_supported(("bucket", True)) @@ -721,7 +744,8 @@ def search( _vars = ["?id"] for i, k in enumerate(self.service.store_metadata_keys): _vars.append(f"?{k}") - store_metadata_statements.insert(i+2, f"<{self.metadata_context.terms[k].id}> ?{k}") + store_metadata_statements.insert( + i + 2, f"<{self.metadata_context.terms[k].id}> ?{k}") deprecated_filter = f"Filter (?_deprecated = {format_type[CategoryDataType.BOOLEAN](deprecated)})" query_filters.append(deprecated_filter) else: @@ -891,13 +915,15 @@ def triples_to_resource(iri, triples): # SELECT QUERY results = data["results"]["bindings"] return [ - Resource(**{k: json.loads(str(v["value"]).lower()) if v['type'] =='literal' and - ('datatype' in v and v['datatype']=='http://www.w3.org/2001/XMLSchema#boolean') - else (int(v["value"]) if v['type'] =='literal' and - ('datatype' in v and v['datatype']=='http://www.w3.org/2001/XMLSchema#integer') - else v["value"] - ) - for k, v in x.items()} ) + Resource(**{k: json.loads(str(v["value"]).lower()) if v['type'] == 'literal' and + ('datatype' in v and v['datatype'] == + 'http://www.w3.org/2001/XMLSchema#boolean') + else (int(v["value"]) if v['type'] == 'literal' and + ('datatype' in v and v['datatype'] == + 'http://www.w3.org/2001/XMLSchema#integer') + else v["value"] + ) + for k, v in x.items()}) for x in results ]