Repository: BlueBrain/nexus-forge (language: python)

Issue:
Disable SPARQL rewriting when a correct SPARQL is provided.

forge.sparql(): Allow `LIMIT` on the query itself
When using `forge.sparql()`, one cannot provide the `LIMIT` in the query string itself without setting the `limit` argument on the method to `None`.

While this throws a `HTTPError: 400 Client Error: Bad Request for url: https://***defaultSparqlIndex/sparql and QueryingError: 400 Client Error: Bad Request for url: https://***defaultSparqlIndex/sparql` error:

- `forge.sparql("SELECT ?s ?p ?o WHERE {?s ?p ?o} LIMIT 20")`

the following work:
- `forge.sparql("SELECT ?s ?p ?o WHERE {?s ?p ?o}", limit=20)`
- `forge.sparql("SELECT ?s ?p ?o WHERE {?s ?p ?o} LIMIT 20", limit=None)`

A user should be allowed to provide the `LIMIT` in the query string itself without having to set the `limit` argument to `None`

The limit default value is set here:
- https://github.com/BlueBrain/nexus-forge/blob/a65d4e37e6b30f3261c5914fb1e536720b41dd00/kgforge/core/forge.py#L347

The query string is being built here: 
- https://github.com/BlueBrain/nexus-forge/blob/9287baa6338876fd0e61624f97e21e2d6679b274/kgforge/specializations/stores/bluebrain_nexus.py#L453
Support ns free filtering with store_metadata values
BlueBrainNexus store adds _createdAt, _updatedAt, _rev. It would be good to support filtering with those when calling forge.search()  without specifying BlueBrainNexus store default namespace.
Disable SPARQL rewriting when a correct SPARQL is provided.



Discussion / hints:

Would it be possible to improve the error message too? I assume that the reason for the rejection is invalid SPARQL (`None` maybe ends up in the query string).
Consider adding store_metadata in wrap_paths


Fix patch:
diff --git a/docs/source/interaction.rst b/docs/source/interaction.rst
index 0463f877..3c90af8d 100644
--- a/docs/source/interaction.rst
+++ b/docs/source/interaction.rst
@@ -222,8 +222,8 @@ SPARQL query if supported by the store (4) or by using an ElasticSearch query if
    forge.retrieve(id: str, version: Optional[Union[int, str]] = None, cross_bucket: bool = False) -> Resource
    forge.paths(type: str) -> PathsWrapper # introspect a schema by type and return all defined property paths
    forge.search(*filters, **params) -> List[Resource] # a cross_bucket param can be used to enable cross bucket search (True) or not (False)
-   forge.sparql(query: str, debug: bool, limit: int, offset: int = None) -> List[Resource]
-   forge.elastic(query: str, debug: bool, limit: int, offset: int = None) -> List[Resource] # for elasticsearch query
+   forge.sparql(query: str, debug: bool=False, limit: Optional[int] = None, offset: Optional[int] = None, **params) -> List[Resource]
+   forge.elastic(query: str, debug: bool=False, limit: Optional[int] = None, offset: Optional[int] = None) -> List[Resource] # for elasticsearch query
    forge.download(data: Union[Resource, List[Resource]], follow: str, path: str, overwrite: bool = False, cross_bucket: bool = False) -> None
 
 Currently `forge.search(*filters, **params)` will by default rewrite the filters as a SPARQL query and run it against a configured SPARQL endpoint unless `sparql_endpoint='elastic'` is set and an ElasticSearch search endpoint configured.
diff --git a/examples/notebooks/getting-started/04 - Querying.ipynb b/examples/notebooks/getting-started/04 - Querying.ipynb
index 18cfc078..adadaf8c 100644
--- a/examples/notebooks/getting-started/04 - Querying.ipynb
+++ b/examples/notebooks/getting-started/04 - Querying.ipynb
@@ -16,7 +16,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 1,
+   "execution_count": 5,
    "metadata": {
     "ExecuteTime": {
      "end_time": "2019-09-23T18:50:20.068658Z",
@@ -37,7 +37,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 162,
+   "execution_count": 6,
    "metadata": {},
    "outputs": [],
    "source": [
@@ -46,17 +46,14 @@
   },
   {
    "cell_type": "markdown",
-   "metadata": {
-    "toc-hr-collapsed": true,
-    "toc-nb-collapsed": true
-   },
+   "metadata": {},
    "source": [
     "## Imports"
    ]
   },
   {
    "cell_type": "code",
-   "execution_count": 66,
+   "execution_count": 7,
    "metadata": {},
    "outputs": [],
    "source": [
@@ -81,7 +78,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 4,
+   "execution_count": 8,
    "metadata": {},
    "outputs": [],
    "source": [
@@ -90,7 +87,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 5,
+   "execution_count": 9,
    "metadata": {},
    "outputs": [
     {
@@ -108,7 +105,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 6,
+   "execution_count": 10,
    "metadata": {},
    "outputs": [],
    "source": [
@@ -117,16 +114,16 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 7,
+   "execution_count": 11,
    "metadata": {},
    "outputs": [
     {
      "data": {
       "text/plain": [
-       "False"
+       "True"
       ]
      },
-     "execution_count": 7,
+     "execution_count": 11,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -144,7 +141,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 17,
+   "execution_count": 12,
    "metadata": {},
    "outputs": [],
    "source": [
@@ -153,7 +150,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 18,
+   "execution_count": 13,
    "metadata": {},
    "outputs": [
     {
@@ -171,7 +168,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 19,
+   "execution_count": 14,
    "metadata": {},
    "outputs": [
     {
@@ -189,7 +186,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 20,
+   "execution_count": 15,
    "metadata": {},
    "outputs": [],
    "source": [
@@ -198,7 +195,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 21,
+   "execution_count": 16,
    "metadata": {},
    "outputs": [
     {
@@ -216,7 +213,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 22,
+   "execution_count": 17,
    "metadata": {
     "ExecuteTime": {
      "end_time": "2019-09-23T18:50:21.317601Z",
@@ -243,7 +240,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 23,
+   "execution_count": 18,
    "metadata": {
     "ExecuteTime": {
      "end_time": "2019-09-23T18:50:21.332678Z",
@@ -257,7 +254,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 24,
+   "execution_count": 19,
    "metadata": {
     "ExecuteTime": {
      "end_time": "2019-09-23T18:50:21.370051Z",
@@ -271,7 +268,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 25,
+   "execution_count": 20,
    "metadata": {
     "ExecuteTime": {
      "end_time": "2019-09-23T18:50:21.379911Z",
@@ -285,7 +282,7 @@
        "True"
       ]
      },
-     "execution_count": 25,
+     "execution_count": 20,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -304,7 +301,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 26,
+   "execution_count": 21,
    "metadata": {},
    "outputs": [],
    "source": [
@@ -320,7 +317,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 27,
+   "execution_count": 22,
    "metadata": {},
    "outputs": [
     {
@@ -339,7 +336,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 28,
+   "execution_count": 23,
    "metadata": {},
    "outputs": [
     {
@@ -348,7 +345,7 @@
        "True"
       ]
      },
-     "execution_count": 28,
+     "execution_count": 23,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -373,7 +370,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 29,
+   "execution_count": 24,
    "metadata": {},
    "outputs": [],
    "source": [
@@ -383,7 +380,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 30,
+   "execution_count": 25,
    "metadata": {},
    "outputs": [],
    "source": [
@@ -393,7 +390,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 31,
+   "execution_count": 26,
    "metadata": {},
    "outputs": [],
    "source": [
@@ -403,7 +400,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 32,
+   "execution_count": 27,
    "metadata": {},
    "outputs": [
     {
@@ -421,9 +418,33 @@
   },
   {
    "cell_type": "code",
-   "execution_count": null,
+   "execution_count": 28,
    "metadata": {},
-   "outputs": [],
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "{'id': 'https://sandbox.bluebrainnexus.io/v1/resources/github-users/mfsy/_/52be5400-705b-4f09-9f7c-698df16d0d22',\n",
+       " 'type': 'Dataset',\n",
+       " 'contribution': [{'type': 'Contribution',\n",
+       "   'agent': {'type': 'Person', 'name': 'Jane Doe'}},\n",
+       "  {'type': 'Contribution', 'agent': {'type': 'Person', 'name': 'John Smith'}}],\n",
+       " 'distribution': {'type': 'DataDownload',\n",
+       "  'atLocation': {'type': 'Location',\n",
+       "   'store': {'id': 'https://bluebrain.github.io/nexus/vocabulary/diskStorageDefault'}},\n",
+       "  'contentSize': {'unitCode': 'bytes', 'value': 477},\n",
+       "  'contentUrl': 'https://sandbox.bluebrainnexus.io/v1/files/github-users/mfsy/a6ad5f00-2cef-492c-8299-ee2b440e284f',\n",
+       "  'digest': {'algorithm': 'SHA-256',\n",
+       "   'value': '789aa07948683fe036ac29811814a826b703b562f7d168eb70dee1fabde26859'},\n",
+       "  'encodingFormat': 'text/tab-separated-values',\n",
+       "  'name': 'associations.tsv'}}"
+      ]
+     },
+     "execution_count": 28,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
    "source": [
     "forge.as_json(dataset)"
    ]
@@ -432,7 +453,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "### Paths as filters"
+    "### Using resource paths as filters"
    ]
   },
   {
@@ -446,7 +467,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 34,
+   "execution_count": 29,
    "metadata": {},
    "outputs": [],
    "source": [
@@ -476,7 +497,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 80,
+   "execution_count": 30,
    "metadata": {},
    "outputs": [],
    "source": [
@@ -485,7 +506,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 81,
+   "execution_count": 31,
    "metadata": {},
    "outputs": [
     {
@@ -494,7 +515,7 @@
        "list"
       ]
      },
-     "execution_count": 81,
+     "execution_count": 31,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -505,7 +526,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 37,
+   "execution_count": 32,
    "metadata": {},
    "outputs": [
     {
@@ -514,7 +535,7 @@
        "3"
       ]
      },
-     "execution_count": 37,
+     "execution_count": 32,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -525,7 +546,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 38,
+   "execution_count": 33,
    "metadata": {},
    "outputs": [
     {
@@ -551,18 +572,7 @@
        "      <th></th>\n",
        "      <th>id</th>\n",
        "      <th>type</th>\n",
-       "      <th>_schemaProject</th>\n",
        "      <th>name</th>\n",
-       "      <th>distribution.type</th>\n",
-       "      <th>distribution.atLocation.type</th>\n",
-       "      <th>distribution.atLocation.store.id</th>\n",
-       "      <th>distribution.contentSize.unitCode</th>\n",
-       "      <th>distribution.contentSize.value</th>\n",
-       "      <th>distribution.contentUrl</th>\n",
-       "      <th>distribution.digest.algorithm</th>\n",
-       "      <th>distribution.digest.value</th>\n",
-       "      <th>distribution.encodingFormat</th>\n",
-       "      <th>distribution.name</th>\n",
        "    </tr>\n",
        "  </thead>\n",
        "  <tbody>\n",
@@ -570,105 +580,32 @@
        "      <th>0</th>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
        "      <td>Person</td>\n",
-       "      <td>https://sandbox.bluebrainnexus.io/v1/projects/...</td>\n",
        "      <td>Jane Doe</td>\n",
-       "      <td>NaN</td>\n",
-       "      <td>NaN</td>\n",
-       "      <td>NaN</td>\n",
-       "      <td>NaN</td>\n",
-       "      <td>NaN</td>\n",
-       "      <td>NaN</td>\n",
-       "      <td>NaN</td>\n",
-       "      <td>NaN</td>\n",
-       "      <td>NaN</td>\n",
-       "      <td>NaN</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1</th>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
        "      <td>Person</td>\n",
-       "      <td>https://sandbox.bluebrainnexus.io/v1/projects/...</td>\n",
-       "      <td>John Smith</td>\n",
-       "      <td>NaN</td>\n",
-       "      <td>NaN</td>\n",
-       "      <td>NaN</td>\n",
-       "      <td>NaN</td>\n",
-       "      <td>NaN</td>\n",
-       "      <td>NaN</td>\n",
-       "      <td>NaN</td>\n",
-       "      <td>NaN</td>\n",
-       "      <td>NaN</td>\n",
-       "      <td>NaN</td>\n",
+       "      <td>Jane Doe</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>2</th>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
        "      <td>Person</td>\n",
-       "      <td>https://sandbox.bluebrainnexus.io/v1/projects/...</td>\n",
        "      <td>Jane Doe</td>\n",
-       "      <td>DataDownload</td>\n",
-       "      <td>Location</td>\n",
-       "      <td>https://bluebrain.github.io/nexus/vocabulary/d...</td>\n",
-       "      <td>bytes</td>\n",
-       "      <td>52.0</td>\n",
-       "      <td>https://sandbox.bluebrainnexus.io/v1/files/git...</td>\n",
-       "      <td>SHA-256</td>\n",
-       "      <td>1dacd765946963fda4949753659089c5f532714b418d30...</td>\n",
-       "      <td>text/csv</td>\n",
-       "      <td>persons.csv</td>\n",
        "    </tr>\n",
        "  </tbody>\n",
        "</table>\n",
        "</div>"
       ],
       "text/plain": [
-       "                                                  id    type  \\\n",
-       "0  https://sandbox.bluebrainnexus.io/v1/resources...  Person   \n",
-       "1  https://sandbox.bluebrainnexus.io/v1/resources...  Person   \n",
-       "2  https://sandbox.bluebrainnexus.io/v1/resources...  Person   \n",
-       "\n",
-       "                                      _schemaProject        name  \\\n",
-       "0  https://sandbox.bluebrainnexus.io/v1/projects/...    Jane Doe   \n",
-       "1  https://sandbox.bluebrainnexus.io/v1/projects/...  John Smith   \n",
-       "2  https://sandbox.bluebrainnexus.io/v1/projects/...    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.contentSize.unitCode  distribution.contentSize.value  \\\n",
-       "0                               NaN                             NaN   \n",
-       "1                               NaN                             NaN   \n",
-       "2                             bytes                            52.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  1dacd765946963fda4949753659089c5f532714b418d30...   \n",
-       "\n",
-       "  distribution.encodingFormat distribution.name  \n",
-       "0                         NaN               NaN  \n",
-       "1                         NaN               NaN  \n",
-       "2                    text/csv       persons.csv  "
+       "                                                  id    type      name\n",
+       "0  https://sandbox.bluebrainnexus.io/v1/resources...  Person  Jane Doe\n",
+       "1  https://sandbox.bluebrainnexus.io/v1/resources...  Person  Jane Doe\n",
+       "2  https://sandbox.bluebrainnexus.io/v1/resources...  Person  Jane Doe"
       ]
      },
-     "execution_count": 38,
+     "execution_count": 33,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -679,16 +616,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": null,
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "forge.as_json(resources[2])"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": 48,
+   "execution_count": 34,
    "metadata": {},
    "outputs": [
     {
@@ -714,7 +642,6 @@
        "      <th></th>\n",
        "      <th>id</th>\n",
        "      <th>type</th>\n",
-       "      <th>_schemaProject</th>\n",
        "      <th>name</th>\n",
        "      <th>_constrainedBy</th>\n",
        "      <th>_createdAt</th>\n",
@@ -722,17 +649,12 @@
        "      <th>_deprecated</th>\n",
        "      <th>_incoming</th>\n",
        "      <th>_outgoing</th>\n",
-       "      <th>...</th>\n",
-       "      <th>distribution.type</th>\n",
-       "      <th>distribution.atLocation.type</th>\n",
-       "      <th>distribution.atLocation.store.id</th>\n",
-       "      <th>distribution.contentSize.unitCode</th>\n",
-       "      <th>distribution.contentSize.value</th>\n",
-       "      <th>distribution.contentUrl</th>\n",
-       "      <th>distribution.digest.algorithm</th>\n",
-       "      <th>distribution.digest.value</th>\n",
-       "      <th>distribution.encodingFormat</th>\n",
-       "      <th>distribution.name</th>\n",
+       "      <th>_project</th>\n",
+       "      <th>_rev</th>\n",
+       "      <th>_schemaProject</th>\n",
+       "      <th>_self</th>\n",
+       "      <th>_updatedAt</th>\n",
+       "      <th>_updatedBy</th>\n",
        "    </tr>\n",
        "  </thead>\n",
        "  <tbody>\n",
@@ -740,89 +662,65 @@
        "      <th>0</th>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
        "      <td>Person</td>\n",
-       "      <td>https://sandbox.bluebrainnexus.io/v1/projects/...</td>\n",
        "      <td>Jane Doe</td>\n",
        "      <td>https://bluebrain.github.io/nexus/schemas/unco...</td>\n",
-       "      <td>2022-01-06T15:46:40.285Z</td>\n",
+       "      <td>2022-01-16T15:13:50.255Z</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/realms/gi...</td>\n",
        "      <td>False</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
-       "      <td>...</td>\n",
-       "      <td>NaN</td>\n",
-       "      <td>NaN</td>\n",
-       "      <td>NaN</td>\n",
-       "      <td>NaN</td>\n",
-       "      <td>NaN</td>\n",
-       "      <td>NaN</td>\n",
-       "      <td>NaN</td>\n",
-       "      <td>NaN</td>\n",
-       "      <td>NaN</td>\n",
-       "      <td>NaN</td>\n",
+       "      <td>https://sandbox.bluebrainnexus.io/v1/projects/...</td>\n",
+       "      <td>1</td>\n",
+       "      <td>https://sandbox.bluebrainnexus.io/v1/projects/...</td>\n",
+       "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
+       "      <td>2022-01-16T15:13:50.255Z</td>\n",
+       "      <td>https://sandbox.bluebrainnexus.io/v1/realms/gi...</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1</th>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
        "      <td>Person</td>\n",
-       "      <td>https://sandbox.bluebrainnexus.io/v1/projects/...</td>\n",
        "      <td>Jane Doe</td>\n",
        "      <td>https://bluebrain.github.io/nexus/schemas/unco...</td>\n",
-       "      <td>2022-01-06T15:47:00.719Z</td>\n",
+       "      <td>2022-01-16T15:34:58.885Z</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/realms/gi...</td>\n",
        "      <td>False</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
-       "      <td>...</td>\n",
-       "      <td>DataDownload</td>\n",
-       "      <td>Location</td>\n",
-       "      <td>https://bluebrain.github.io/nexus/vocabulary/d...</td>\n",
-       "      <td>bytes</td>\n",
-       "      <td>52.0</td>\n",
-       "      <td>https://sandbox.bluebrainnexus.io/v1/files/git...</td>\n",
-       "      <td>SHA-256</td>\n",
-       "      <td>1dacd765946963fda4949753659089c5f532714b418d30...</td>\n",
-       "      <td>text/csv</td>\n",
-       "      <td>persons.csv</td>\n",
+       "      <td>https://sandbox.bluebrainnexus.io/v1/projects/...</td>\n",
+       "      <td>1</td>\n",
+       "      <td>https://sandbox.bluebrainnexus.io/v1/projects/...</td>\n",
+       "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
+       "      <td>2022-01-16T15:34:58.885Z</td>\n",
+       "      <td>https://sandbox.bluebrainnexus.io/v1/realms/gi...</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>2</th>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
        "      <td>Person</td>\n",
-       "      <td>https://sandbox.bluebrainnexus.io/v1/projects/...</td>\n",
        "      <td>Jane Doe</td>\n",
        "      <td>https://bluebrain.github.io/nexus/schemas/unco...</td>\n",
-       "      <td>2022-01-07T11:26:11.330Z</td>\n",
+       "      <td>2022-01-16T15:40:36.400Z</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/realms/gi...</td>\n",
        "      <td>False</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
-       "      <td>...</td>\n",
-       "      <td>NaN</td>\n",
-       "      <td>NaN</td>\n",
-       "      <td>NaN</td>\n",
-       "      <td>NaN</td>\n",
-       "      <td>NaN</td>\n",
-       "      <td>NaN</td>\n",
-       "      <td>NaN</td>\n",
-       "      <td>NaN</td>\n",
-       "      <td>NaN</td>\n",
-       "      <td>NaN</td>\n",
+       "      <td>https://sandbox.bluebrainnexus.io/v1/projects/...</td>\n",
+       "      <td>1</td>\n",
+       "      <td>https://sandbox.bluebrainnexus.io/v1/projects/...</td>\n",
+       "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
+       "      <td>2022-01-16T15:40:36.400Z</td>\n",
+       "      <td>https://sandbox.bluebrainnexus.io/v1/realms/gi...</td>\n",
        "    </tr>\n",
        "  </tbody>\n",
        "</table>\n",
-       "<p>3 rows × 25 columns</p>\n",
        "</div>"
       ],
       "text/plain": [
-       "                                                  id    type  \\\n",
-       "0  https://sandbox.bluebrainnexus.io/v1/resources...  Person   \n",
-       "1  https://sandbox.bluebrainnexus.io/v1/resources...  Person   \n",
-       "2  https://sandbox.bluebrainnexus.io/v1/resources...  Person   \n",
-       "\n",
-       "                                      _schemaProject      name  \\\n",
-       "0  https://sandbox.bluebrainnexus.io/v1/projects/...  Jane Doe   \n",
-       "1  https://sandbox.bluebrainnexus.io/v1/projects/...  Jane Doe   \n",
-       "2  https://sandbox.bluebrainnexus.io/v1/projects/...  Jane Doe   \n",
+       "                                                  id    type      name  \\\n",
+       "0  https://sandbox.bluebrainnexus.io/v1/resources...  Person  Jane Doe   \n",
+       "1  https://sandbox.bluebrainnexus.io/v1/resources...  Person  Jane Doe   \n",
+       "2  https://sandbox.bluebrainnexus.io/v1/resources...  Person  Jane Doe   \n",
        "\n",
        "                                      _constrainedBy  \\\n",
        "0  https://bluebrain.github.io/nexus/schemas/unco...   \n",
@@ -830,9 +728,9 @@
        "2  https://bluebrain.github.io/nexus/schemas/unco...   \n",
        "\n",
        "                 _createdAt  \\\n",
-       "0  2022-01-06T15:46:40.285Z   \n",
-       "1  2022-01-06T15:47:00.719Z   \n",
-       "2  2022-01-07T11:26:11.330Z   \n",
+       "0  2022-01-16T15:13:50.255Z   \n",
+       "1  2022-01-16T15:34:58.885Z   \n",
+       "2  2022-01-16T15:40:36.400Z   \n",
        "\n",
        "                                          _createdBy  _deprecated  \\\n",
        "0  https://sandbox.bluebrainnexus.io/v1/realms/gi...        False   \n",
@@ -844,50 +742,33 @@
        "1  https://sandbox.bluebrainnexus.io/v1/resources...   \n",
        "2  https://sandbox.bluebrainnexus.io/v1/resources...   \n",
        "\n",
-       "                                           _outgoing  ... distribution.type  \\\n",
-       "0  https://sandbox.bluebrainnexus.io/v1/resources...  ...               NaN   \n",
-       "1  https://sandbox.bluebrainnexus.io/v1/resources...  ...      DataDownload   \n",
-       "2  https://sandbox.bluebrainnexus.io/v1/resources...  ...               NaN   \n",
-       "\n",
-       "   distribution.atLocation.type  \\\n",
-       "0                           NaN   \n",
-       "1                      Location   \n",
-       "2                           NaN   \n",
-       "\n",
-       "                    distribution.atLocation.store.id  \\\n",
-       "0                                                NaN   \n",
-       "1  https://bluebrain.github.io/nexus/vocabulary/d...   \n",
-       "2                                                NaN   \n",
-       "\n",
-       "  distribution.contentSize.unitCode distribution.contentSize.value  \\\n",
-       "0                               NaN                            NaN   \n",
-       "1                             bytes                           52.0   \n",
-       "2                               NaN                            NaN   \n",
-       "\n",
-       "                             distribution.contentUrl  \\\n",
-       "0                                                NaN   \n",
-       "1  https://sandbox.bluebrainnexus.io/v1/files/git...   \n",
-       "2                                                NaN   \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.digest.algorithm  \\\n",
-       "0                           NaN   \n",
-       "1                       SHA-256   \n",
-       "2                           NaN   \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.value  \\\n",
-       "0                                                NaN   \n",
-       "1  1dacd765946963fda4949753659089c5f532714b418d30...   \n",
-       "2                                                NaN   \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.encodingFormat  distribution.name  \n",
-       "0                         NaN                NaN  \n",
-       "1                    text/csv        persons.csv  \n",
-       "2                         NaN                NaN  \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",
-       "[3 rows x 25 columns]"
+       "                 _updatedAt                                         _updatedBy  \n",
+       "0  2022-01-16T15:13:50.255Z  https://sandbox.bluebrainnexus.io/v1/realms/gi...  \n",
+       "1  2022-01-16T15:34:58.885Z  https://sandbox.bluebrainnexus.io/v1/realms/gi...  \n",
+       "2  2022-01-16T15:40:36.400Z  https://sandbox.bluebrainnexus.io/v1/realms/gi...  "
       ]
      },
-     "execution_count": 48,
+     "execution_count": 34,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -900,7 +781,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "#### Nested property querying"
+    "#### Using nested resource property"
    ]
   },
   {
@@ -912,17 +793,17 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 41,
+   "execution_count": 35,
    "metadata": {},
    "outputs": [],
    "source": [
-    "# Search for resources of type Person and with text/tab-separated-values as distribution.encodingFormat\n",
-    "resources = forge.search(p.type.id == \"Person\", p.distribution.encodingFormat == \"text/tab-separated-values\", limit=3)"
+    "# 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": 42,
+   "execution_count": 36,
    "metadata": {},
    "outputs": [
     {
@@ -931,7 +812,7 @@
        "3"
       ]
      },
-     "execution_count": 42,
+     "execution_count": 36,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -942,7 +823,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 43,
+   "execution_count": 37,
    "metadata": {
     "scrolled": true
    },
@@ -970,7 +851,7 @@
        "      <th></th>\n",
        "      <th>id</th>\n",
        "      <th>type</th>\n",
-       "      <th>_schemaProject</th>\n",
+       "      <th>contribution</th>\n",
        "      <th>distribution.type</th>\n",
        "      <th>distribution.atLocation.type</th>\n",
        "      <th>distribution.atLocation.store.id</th>\n",
@@ -981,75 +862,71 @@
        "      <th>distribution.digest.value</th>\n",
        "      <th>distribution.encodingFormat</th>\n",
        "      <th>distribution.name</th>\n",
-       "      <th>name</th>\n",
        "    </tr>\n",
        "  </thead>\n",
        "  <tbody>\n",
        "    <tr>\n",
        "      <th>0</th>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
-       "      <td>Person</td>\n",
-       "      <td>https://sandbox.bluebrainnexus.io/v1/projects/...</td>\n",
+       "      <td>Dataset</td>\n",
+       "      <td>[{'type': 'Contribution', 'agent': {'type': 'P...</td>\n",
        "      <td>DataDownload</td>\n",
        "      <td>Location</td>\n",
        "      <td>https://bluebrain.github.io/nexus/vocabulary/d...</td>\n",
        "      <td>bytes</td>\n",
-       "      <td>506</td>\n",
+       "      <td>477</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/files/git...</td>\n",
        "      <td>SHA-256</td>\n",
-       "      <td>9639abc864e91c645779f510ae5c06a1618941d569eb1a...</td>\n",
+       "      <td>789aa07948683fe036ac29811814a826b703b562f7d168...</td>\n",
        "      <td>text/tab-separated-values</td>\n",
        "      <td>associations.tsv</td>\n",
-       "      <td>Jane Doe</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1</th>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
-       "      <td>Person</td>\n",
-       "      <td>https://sandbox.bluebrainnexus.io/v1/projects/...</td>\n",
+       "      <td>Dataset</td>\n",
+       "      <td>[{'type': 'Contribution', 'agent': {'type': 'P...</td>\n",
        "      <td>DataDownload</td>\n",
        "      <td>Location</td>\n",
        "      <td>https://bluebrain.github.io/nexus/vocabulary/d...</td>\n",
        "      <td>bytes</td>\n",
-       "      <td>506</td>\n",
+       "      <td>477</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/files/git...</td>\n",
        "      <td>SHA-256</td>\n",
-       "      <td>9639abc864e91c645779f510ae5c06a1618941d569eb1a...</td>\n",
+       "      <td>789aa07948683fe036ac29811814a826b703b562f7d168...</td>\n",
        "      <td>text/tab-separated-values</td>\n",
        "      <td>associations.tsv</td>\n",
-       "      <td>Jane Doe</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>2</th>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
-       "      <td>Person</td>\n",
-       "      <td>https://sandbox.bluebrainnexus.io/v1/projects/...</td>\n",
+       "      <td>Dataset</td>\n",
+       "      <td>[{'type': 'Contribution', 'agent': {'type': 'P...</td>\n",
        "      <td>DataDownload</td>\n",
        "      <td>Location</td>\n",
        "      <td>https://bluebrain.github.io/nexus/vocabulary/d...</td>\n",
        "      <td>bytes</td>\n",
-       "      <td>506</td>\n",
+       "      <td>477</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/files/git...</td>\n",
        "      <td>SHA-256</td>\n",
-       "      <td>9639abc864e91c645779f510ae5c06a1618941d569eb1a...</td>\n",
+       "      <td>789aa07948683fe036ac29811814a826b703b562f7d168...</td>\n",
        "      <td>text/tab-separated-values</td>\n",
        "      <td>associations.tsv</td>\n",
-       "      <td>Jane Doe</td>\n",
        "    </tr>\n",
        "  </tbody>\n",
        "</table>\n",
        "</div>"
       ],
       "text/plain": [
-       "                                                  id    type  \\\n",
-       "0  https://sandbox.bluebrainnexus.io/v1/resources...  Person   \n",
-       "1  https://sandbox.bluebrainnexus.io/v1/resources...  Person   \n",
-       "2  https://sandbox.bluebrainnexus.io/v1/resources...  Person   \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",
-       "                                      _schemaProject distribution.type  \\\n",
-       "0  https://sandbox.bluebrainnexus.io/v1/projects/...      DataDownload   \n",
-       "1  https://sandbox.bluebrainnexus.io/v1/projects/...      DataDownload   \n",
-       "2  https://sandbox.bluebrainnexus.io/v1/projects/...      DataDownload   \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",
@@ -1062,9 +939,9 @@
        "2  https://bluebrain.github.io/nexus/vocabulary/d...   \n",
        "\n",
        "  distribution.contentSize.unitCode  distribution.contentSize.value  \\\n",
-       "0                             bytes                             506   \n",
-       "1                             bytes                             506   \n",
-       "2                             bytes                             506   \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",
@@ -1077,17 +954,17 @@
        "2                       SHA-256   \n",
        "\n",
        "                           distribution.digest.value  \\\n",
-       "0  9639abc864e91c645779f510ae5c06a1618941d569eb1a...   \n",
-       "1  9639abc864e91c645779f510ae5c06a1618941d569eb1a...   \n",
-       "2  9639abc864e91c645779f510ae5c06a1618941d569eb1a...   \n",
-       "\n",
-       "  distribution.encodingFormat distribution.name      name  \n",
-       "0   text/tab-separated-values  associations.tsv  Jane Doe  \n",
-       "1   text/tab-separated-values  associations.tsv  Jane Doe  \n",
-       "2   text/tab-separated-values  associations.tsv  Jane Doe  "
+       "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": 43,
+     "execution_count": 37,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -1100,7 +977,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "### Dict as filters\n",
+    "### 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",
@@ -1112,18 +989,18 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 49,
+   "execution_count": 38,
    "metadata": {},
    "outputs": [],
    "source": [
-    "# Search for resources of type Person and with text/tab-separated-values as distribution.encodingFormat\n",
-    "filters = {\"type\": \"Person\", \"distribution\":{\"encodingFormat\":\"text/tab-separated-values\"}}\n",
+    "# Search for resources of type Dataset and with text/tab-separated-values as distribution.encodingFormat and created a given datetime.\n",
+    "filters = {\"type\": \"Dataset\", \"distribution\":{\"encodingFormat\":\"text/tab-separated-values\"}, \"_createdAt\":dataset._store_metadata._createdAt}\n",
     "resources = forge.search(filters, limit=3)"
    ]
   },
   {
    "cell_type": "code",
-   "execution_count": 50,
+   "execution_count": 39,
    "metadata": {},
    "outputs": [
     {
@@ -1132,7 +1009,7 @@
        "list"
       ]
      },
-     "execution_count": 50,
+     "execution_count": 39,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -1143,16 +1020,16 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 51,
+   "execution_count": 40,
    "metadata": {},
    "outputs": [
     {
      "data": {
       "text/plain": [
-       "3"
+       "1"
       ]
      },
-     "execution_count": 51,
+     "execution_count": 40,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -1163,7 +1040,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 52,
+   "execution_count": 41,
    "metadata": {},
    "outputs": [
     {
@@ -1189,7 +1066,7 @@
        "      <th></th>\n",
        "      <th>id</th>\n",
        "      <th>type</th>\n",
-       "      <th>_schemaProject</th>\n",
+       "      <th>contribution</th>\n",
        "      <th>distribution.type</th>\n",
        "      <th>distribution.atLocation.type</th>\n",
        "      <th>distribution.atLocation.store.id</th>\n",
@@ -1198,13 +1075,13 @@
        "      <th>distribution.contentUrl</th>\n",
        "      <th>distribution.digest.algorithm</th>\n",
        "      <th>...</th>\n",
-       "      <th>_createdAt</th>\n",
        "      <th>_createdBy</th>\n",
        "      <th>_deprecated</th>\n",
        "      <th>_incoming</th>\n",
        "      <th>_outgoing</th>\n",
        "      <th>_project</th>\n",
        "      <th>_rev</th>\n",
+       "      <th>_schemaProject</th>\n",
        "      <th>_self</th>\n",
        "      <th>_updatedAt</th>\n",
        "      <th>_updatedBy</th>\n",
@@ -1214,150 +1091,79 @@
        "    <tr>\n",
        "      <th>0</th>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
-       "      <td>Person</td>\n",
-       "      <td>https://sandbox.bluebrainnexus.io/v1/projects/...</td>\n",
+       "      <td>Dataset</td>\n",
+       "      <td>[{'type': 'Contribution', 'agent': {'type': 'P...</td>\n",
        "      <td>DataDownload</td>\n",
        "      <td>Location</td>\n",
        "      <td>https://bluebrain.github.io/nexus/vocabulary/d...</td>\n",
        "      <td>bytes</td>\n",
-       "      <td>506</td>\n",
+       "      <td>477</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/files/git...</td>\n",
        "      <td>SHA-256</td>\n",
        "      <td>...</td>\n",
-       "      <td>2021-08-17T11:00:14.662Z</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/realms/gi...</td>\n",
        "      <td>False</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/projects/...</td>\n",
        "      <td>1</td>\n",
-       "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
-       "      <td>2021-08-17T11:00:14.662Z</td>\n",
-       "      <td>https://sandbox.bluebrainnexus.io/v1/realms/gi...</td>\n",
-       "    </tr>\n",
-       "    <tr>\n",
-       "      <th>1</th>\n",
-       "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
-       "      <td>Person</td>\n",
-       "      <td>https://sandbox.bluebrainnexus.io/v1/projects/...</td>\n",
-       "      <td>DataDownload</td>\n",
-       "      <td>Location</td>\n",
-       "      <td>https://bluebrain.github.io/nexus/vocabulary/d...</td>\n",
-       "      <td>bytes</td>\n",
-       "      <td>506</td>\n",
-       "      <td>https://sandbox.bluebrainnexus.io/v1/files/git...</td>\n",
-       "      <td>SHA-256</td>\n",
-       "      <td>...</td>\n",
-       "      <td>2021-08-23T09:12:24.049Z</td>\n",
-       "      <td>https://sandbox.bluebrainnexus.io/v1/realms/gi...</td>\n",
-       "      <td>False</td>\n",
-       "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
-       "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/projects/...</td>\n",
-       "      <td>1</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
-       "      <td>2021-08-23T09:12:24.049Z</td>\n",
-       "      <td>https://sandbox.bluebrainnexus.io/v1/realms/gi...</td>\n",
-       "    </tr>\n",
-       "    <tr>\n",
-       "      <th>2</th>\n",
-       "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
-       "      <td>Person</td>\n",
-       "      <td>https://sandbox.bluebrainnexus.io/v1/projects/...</td>\n",
-       "      <td>DataDownload</td>\n",
-       "      <td>Location</td>\n",
-       "      <td>https://bluebrain.github.io/nexus/vocabulary/d...</td>\n",
-       "      <td>bytes</td>\n",
-       "      <td>506</td>\n",
-       "      <td>https://sandbox.bluebrainnexus.io/v1/files/git...</td>\n",
-       "      <td>SHA-256</td>\n",
-       "      <td>...</td>\n",
-       "      <td>2021-08-23T09:18:43.327Z</td>\n",
-       "      <td>https://sandbox.bluebrainnexus.io/v1/realms/gi...</td>\n",
-       "      <td>False</td>\n",
-       "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
-       "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
-       "      <td>https://sandbox.bluebrainnexus.io/v1/projects/...</td>\n",
-       "      <td>1</td>\n",
-       "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
-       "      <td>2021-08-23T09:18:43.327Z</td>\n",
+       "      <td>2022-01-20T21:48:23.080Z</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/realms/gi...</td>\n",
        "    </tr>\n",
        "  </tbody>\n",
        "</table>\n",
-       "<p>3 rows × 25 columns</p>\n",
+       "<p>1 rows × 25 columns</p>\n",
        "</div>"
       ],
       "text/plain": [
-       "                                                  id    type  \\\n",
-       "0  https://sandbox.bluebrainnexus.io/v1/resources...  Person   \n",
-       "1  https://sandbox.bluebrainnexus.io/v1/resources...  Person   \n",
-       "2  https://sandbox.bluebrainnexus.io/v1/resources...  Person   \n",
+       "                                                  id     type  \\\n",
+       "0  https://sandbox.bluebrainnexus.io/v1/resources...  Dataset   \n",
        "\n",
-       "                                      _schemaProject distribution.type  \\\n",
-       "0  https://sandbox.bluebrainnexus.io/v1/projects/...      DataDownload   \n",
-       "1  https://sandbox.bluebrainnexus.io/v1/projects/...      DataDownload   \n",
-       "2  https://sandbox.bluebrainnexus.io/v1/projects/...      DataDownload   \n",
+       "                                        contribution distribution.type  \\\n",
+       "0  [{'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.contentSize.unitCode  distribution.contentSize.value  \\\n",
-       "0                             bytes                             506   \n",
-       "1                             bytes                             506   \n",
-       "2                             bytes                             506   \n",
+       "0                             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  ...                _createdAt  \\\n",
-       "0                       SHA-256  ...  2021-08-17T11:00:14.662Z   \n",
-       "1                       SHA-256  ...  2021-08-23T09:12:24.049Z   \n",
-       "2                       SHA-256  ...  2021-08-23T09:18:43.327Z   \n",
+       "  distribution.digest.algorithm  ...  \\\n",
+       "0                       SHA-256  ...   \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",
        "                                            _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",
+       "                                      _schemaProject  \\\n",
+       "0  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",
        "\n",
        "                 _updatedAt                                         _updatedBy  \n",
-       "0  2021-08-17T11:00:14.662Z  https://sandbox.bluebrainnexus.io/v1/realms/gi...  \n",
-       "1  2021-08-23T09:12:24.049Z  https://sandbox.bluebrainnexus.io/v1/realms/gi...  \n",
-       "2  2021-08-23T09:18:43.327Z  https://sandbox.bluebrainnexus.io/v1/realms/gi...  \n",
+       "0  2022-01-20T21:48:23.080Z  https://sandbox.bluebrainnexus.io/v1/realms/gi...  \n",
        "\n",
-       "[3 rows x 25 columns]"
+       "[1 rows x 25 columns]"
       ]
      },
-     "execution_count": 52,
+     "execution_count": 41,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -1370,7 +1176,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "### Built-in Filter objects"
+    "### Using built-in Filter objects"
    ]
   },
   {
@@ -1382,7 +1188,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 83,
+   "execution_count": 42,
    "metadata": {},
    "outputs": [
     {
@@ -1396,7 +1202,7 @@
        " '__ge__ (GREATER_OR_Equal_Than)']"
       ]
      },
-     "execution_count": 83,
+     "execution_count": 42,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -1407,20 +1213,20 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 84,
+   "execution_count": 43,
    "metadata": {},
    "outputs": [],
    "source": [
-    "# Search for resources of type Person and with text/tab-separated-values as distribution.encodingFormat\n",
-    "\n",
-    "filter_1 = Filter(operator=\"__eq__\", path=[\"type\"], value=\"Person\")\n",
+    "# Search for resources of type Dataset and with text/tab-separated-values as distribution.encodingFormat and created before a given datetime.\n",
+    "filter_1 = Filter(operator=\"__eq__\", path=[\"type\"], value=\"Dataset\")\n",
     "filter_2 = Filter(operator=\"__eq__\", path=[\"distribution\",\"encodingFormat\"], value=\"text/tab-separated-values\")\n",
-    "resources = forge.search(filter_1,filter_2, limit=3)"
+    "filter_3 = Filter(operator=\"__le__\", path=[\"_createdAt\"], value=dataset._store_metadata._createdAt)\n",
+    "resources = forge.search(filter_1, filter_2, filter_3, limit=3)"
    ]
   },
   {
    "cell_type": "code",
-   "execution_count": 85,
+   "execution_count": 44,
    "metadata": {},
    "outputs": [
     {
@@ -1429,7 +1235,7 @@
        "list"
       ]
      },
-     "execution_count": 85,
+     "execution_count": 44,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -1440,7 +1246,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 86,
+   "execution_count": 45,
    "metadata": {},
    "outputs": [
     {
@@ -1449,7 +1255,7 @@
        "3"
       ]
      },
-     "execution_count": 86,
+     "execution_count": 45,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -1460,7 +1266,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 87,
+   "execution_count": 46,
    "metadata": {},
    "outputs": [
     {
@@ -1486,7 +1292,7 @@
        "      <th></th>\n",
        "      <th>id</th>\n",
        "      <th>type</th>\n",
-       "      <th>_schemaProject</th>\n",
+       "      <th>contribution</th>\n",
        "      <th>distribution.type</th>\n",
        "      <th>distribution.atLocation.type</th>\n",
        "      <th>distribution.atLocation.store.id</th>\n",
@@ -1495,13 +1301,13 @@
        "      <th>distribution.contentUrl</th>\n",
        "      <th>distribution.digest.algorithm</th>\n",
        "      <th>...</th>\n",
-       "      <th>_createdAt</th>\n",
        "      <th>_createdBy</th>\n",
        "      <th>_deprecated</th>\n",
        "      <th>_incoming</th>\n",
        "      <th>_outgoing</th>\n",
        "      <th>_project</th>\n",
        "      <th>_rev</th>\n",
+       "      <th>_schemaProject</th>\n",
        "      <th>_self</th>\n",
        "      <th>_updatedAt</th>\n",
        "      <th>_updatedBy</th>\n",
@@ -1511,73 +1317,73 @@
        "    <tr>\n",
        "      <th>0</th>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
-       "      <td>Person</td>\n",
-       "      <td>https://sandbox.bluebrainnexus.io/v1/projects/...</td>\n",
+       "      <td>Dataset</td>\n",
+       "      <td>[{'type': 'Contribution', 'agent': {'type': 'P...</td>\n",
        "      <td>DataDownload</td>\n",
        "      <td>Location</td>\n",
        "      <td>https://bluebrain.github.io/nexus/vocabulary/d...</td>\n",
        "      <td>bytes</td>\n",
-       "      <td>506</td>\n",
+       "      <td>477</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/files/git...</td>\n",
        "      <td>SHA-256</td>\n",
        "      <td>...</td>\n",
-       "      <td>2021-08-17T11:00:14.662Z</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/realms/gi...</td>\n",
        "      <td>False</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/projects/...</td>\n",
        "      <td>1</td>\n",
+       "      <td>https://sandbox.bluebrainnexus.io/v1/projects/...</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
-       "      <td>2021-08-17T11:00:14.662Z</td>\n",
+       "      <td>2022-01-07T11:30:29.361Z</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/realms/gi...</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1</th>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
-       "      <td>Person</td>\n",
-       "      <td>https://sandbox.bluebrainnexus.io/v1/projects/...</td>\n",
+       "      <td>Dataset</td>\n",
+       "      <td>[{'type': 'Contribution', 'agent': {'type': 'P...</td>\n",
        "      <td>DataDownload</td>\n",
        "      <td>Location</td>\n",
        "      <td>https://bluebrain.github.io/nexus/vocabulary/d...</td>\n",
        "      <td>bytes</td>\n",
-       "      <td>506</td>\n",
+       "      <td>477</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/files/git...</td>\n",
        "      <td>SHA-256</td>\n",
        "      <td>...</td>\n",
-       "      <td>2021-08-23T09:12:24.049Z</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/realms/gi...</td>\n",
        "      <td>False</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/projects/...</td>\n",
        "      <td>1</td>\n",
+       "      <td>https://sandbox.bluebrainnexus.io/v1/projects/...</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
-       "      <td>2021-08-23T09:12:24.049Z</td>\n",
+       "      <td>2022-01-09T22:59:06.807Z</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/realms/gi...</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>2</th>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
-       "      <td>Person</td>\n",
-       "      <td>https://sandbox.bluebrainnexus.io/v1/projects/...</td>\n",
+       "      <td>Dataset</td>\n",
+       "      <td>[{'type': 'Contribution', 'agent': {'type': 'P...</td>\n",
        "      <td>DataDownload</td>\n",
        "      <td>Location</td>\n",
        "      <td>https://bluebrain.github.io/nexus/vocabulary/d...</td>\n",
        "      <td>bytes</td>\n",
-       "      <td>506</td>\n",
+       "      <td>477</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/files/git...</td>\n",
        "      <td>SHA-256</td>\n",
        "      <td>...</td>\n",
-       "      <td>2021-08-23T09:18:43.327Z</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/realms/gi...</td>\n",
        "      <td>False</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/projects/...</td>\n",
        "      <td>1</td>\n",
+       "      <td>https://sandbox.bluebrainnexus.io/v1/projects/...</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
-       "      <td>2021-08-23T09:18:43.327Z</td>\n",
+       "      <td>2022-01-16T14:20:52.535Z</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/realms/gi...</td>\n",
        "    </tr>\n",
        "  </tbody>\n",
@@ -1586,15 +1392,15 @@
        "</div>"
       ],
       "text/plain": [
-       "                                                  id    type  \\\n",
-       "0  https://sandbox.bluebrainnexus.io/v1/resources...  Person   \n",
-       "1  https://sandbox.bluebrainnexus.io/v1/resources...  Person   \n",
-       "2  https://sandbox.bluebrainnexus.io/v1/resources...  Person   \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",
-       "                                      _schemaProject distribution.type  \\\n",
-       "0  https://sandbox.bluebrainnexus.io/v1/projects/...      DataDownload   \n",
-       "1  https://sandbox.bluebrainnexus.io/v1/projects/...      DataDownload   \n",
-       "2  https://sandbox.bluebrainnexus.io/v1/projects/...      DataDownload   \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",
@@ -1607,19 +1413,19 @@
        "2  https://bluebrain.github.io/nexus/vocabulary/d...   \n",
        "\n",
        "  distribution.contentSize.unitCode  distribution.contentSize.value  \\\n",
-       "0                             bytes                             506   \n",
-       "1                             bytes                             506   \n",
-       "2                             bytes                             506   \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  ...                _createdAt  \\\n",
-       "0                       SHA-256  ...  2021-08-17T11:00:14.662Z   \n",
-       "1                       SHA-256  ...  2021-08-23T09:12:24.049Z   \n",
-       "2                       SHA-256  ...  2021-08-23T09:18:43.327Z   \n",
+       "  distribution.digest.algorithm  ...  \\\n",
+       "0                       SHA-256  ...   \n",
+       "1                       SHA-256  ...   \n",
+       "2                       SHA-256  ...   \n",
        "\n",
        "                                          _createdBy _deprecated  \\\n",
        "0  https://sandbox.bluebrainnexus.io/v1/realms/gi...       False   \n",
@@ -1641,20 +1447,25 @@
        "1  https://sandbox.bluebrainnexus.io/v1/projects/...    1   \n",
        "2  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",
+       "\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",
        "                 _updatedAt                                         _updatedBy  \n",
-       "0  2021-08-17T11:00:14.662Z  https://sandbox.bluebrainnexus.io/v1/realms/gi...  \n",
-       "1  2021-08-23T09:12:24.049Z  https://sandbox.bluebrainnexus.io/v1/realms/gi...  \n",
-       "2  2021-08-23T09:18:43.327Z  https://sandbox.bluebrainnexus.io/v1/realms/gi...  \n",
+       "0  2022-01-07T11:30:29.361Z  https://sandbox.bluebrainnexus.io/v1/realms/gi...  \n",
+       "1  2022-01-09T22:59:06.807Z  https://sandbox.bluebrainnexus.io/v1/realms/gi...  \n",
+       "2  2022-01-16T14:20:52.535Z  https://sandbox.bluebrainnexus.io/v1/realms/gi...  \n",
        "\n",
        "[3 rows x 25 columns]"
       ]
      },
-     "execution_count": 87,
+     "execution_count": 46,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -1667,9 +1478,9 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "### Search Endpoints\n",
+    "### Using search endpoints\n",
     "\n",
-    "Two types of search endpoints are supported: 'sparql' 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",
+    "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."
    ]
@@ -1683,18 +1494,18 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 184,
+   "execution_count": 47,
    "metadata": {},
    "outputs": [],
    "source": [
-    "# Search for resources of type Person and with text/tab-separated-values as distribution.encodingFormat\n",
-    "filters = {\"type\": \"Person\", \"distribution\":{\"encodingFormat\":\"text/tab-separated-values\"}}\n",
+    "# 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": 172,
+   "execution_count": 48,
    "metadata": {},
    "outputs": [
     {
@@ -1703,7 +1514,7 @@
        "list"
       ]
      },
-     "execution_count": 172,
+     "execution_count": 48,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -1714,7 +1525,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 173,
+   "execution_count": 49,
    "metadata": {},
    "outputs": [
     {
@@ -1723,7 +1534,7 @@
        "3"
       ]
      },
-     "execution_count": 173,
+     "execution_count": 49,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -1734,7 +1545,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 174,
+   "execution_count": 50,
    "metadata": {},
    "outputs": [
     {
@@ -1760,15 +1571,8 @@
        "      <th></th>\n",
        "      <th>id</th>\n",
        "      <th>type</th>\n",
-       "      <th>_schemaProject</th>\n",
-       "      <th>distribution.type</th>\n",
-       "      <th>distribution.atLocation.type</th>\n",
-       "      <th>distribution.atLocation.store.id</th>\n",
-       "      <th>distribution.contentSize.unitCode</th>\n",
-       "      <th>distribution.contentSize.value</th>\n",
-       "      <th>distribution.contentUrl</th>\n",
-       "      <th>distribution.digest.algorithm</th>\n",
-       "      <th>...</th>\n",
+       "      <th>name</th>\n",
+       "      <th>_constrainedBy</th>\n",
        "      <th>_createdAt</th>\n",
        "      <th>_createdBy</th>\n",
        "      <th>_deprecated</th>\n",
@@ -1776,6 +1580,7 @@
        "      <th>_outgoing</th>\n",
        "      <th>_project</th>\n",
        "      <th>_rev</th>\n",
+       "      <th>_schemaProject</th>\n",
        "      <th>_self</th>\n",
        "      <th>_updatedAt</th>\n",
        "      <th>_updatedBy</th>\n",
@@ -1786,119 +1591,80 @@
        "      <th>0</th>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
        "      <td>Person</td>\n",
-       "      <td>https://sandbox.bluebrainnexus.io/v1/projects/...</td>\n",
-       "      <td>DataDownload</td>\n",
-       "      <td>Location</td>\n",
-       "      <td>https://bluebrain.github.io/nexus/vocabulary/d...</td>\n",
-       "      <td>bytes</td>\n",
-       "      <td>506</td>\n",
-       "      <td>https://sandbox.bluebrainnexus.io/v1/files/git...</td>\n",
-       "      <td>SHA-256</td>\n",
-       "      <td>...</td>\n",
-       "      <td>2021-08-17T11:00:14.662Z</td>\n",
+       "      <td>Jane Doe</td>\n",
+       "      <td>https://bluebrain.github.io/nexus/schemas/unco...</td>\n",
+       "      <td>2022-01-16T15:13:50.255Z</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/realms/gi...</td>\n",
        "      <td>False</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/projects/...</td>\n",
        "      <td>1</td>\n",
+       "      <td>https://sandbox.bluebrainnexus.io/v1/projects/...</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
-       "      <td>2021-08-17T11:00:14.662Z</td>\n",
+       "      <td>2022-01-16T15:13:50.255Z</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/realms/gi...</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1</th>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
        "      <td>Person</td>\n",
-       "      <td>https://sandbox.bluebrainnexus.io/v1/projects/...</td>\n",
-       "      <td>DataDownload</td>\n",
-       "      <td>Location</td>\n",
-       "      <td>https://bluebrain.github.io/nexus/vocabulary/d...</td>\n",
-       "      <td>bytes</td>\n",
-       "      <td>506</td>\n",
-       "      <td>https://sandbox.bluebrainnexus.io/v1/files/git...</td>\n",
-       "      <td>SHA-256</td>\n",
-       "      <td>...</td>\n",
-       "      <td>2021-08-23T09:12:24.049Z</td>\n",
+       "      <td>Jane Doe</td>\n",
+       "      <td>https://bluebrain.github.io/nexus/schemas/unco...</td>\n",
+       "      <td>2022-01-16T15:34:58.885Z</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/realms/gi...</td>\n",
        "      <td>False</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/projects/...</td>\n",
        "      <td>1</td>\n",
+       "      <td>https://sandbox.bluebrainnexus.io/v1/projects/...</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
-       "      <td>2021-08-23T09:12:24.049Z</td>\n",
+       "      <td>2022-01-16T15:34:58.885Z</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/realms/gi...</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>2</th>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
        "      <td>Person</td>\n",
-       "      <td>https://sandbox.bluebrainnexus.io/v1/projects/...</td>\n",
-       "      <td>DataDownload</td>\n",
-       "      <td>Location</td>\n",
-       "      <td>https://bluebrain.github.io/nexus/vocabulary/d...</td>\n",
-       "      <td>bytes</td>\n",
-       "      <td>506</td>\n",
-       "      <td>https://sandbox.bluebrainnexus.io/v1/files/git...</td>\n",
-       "      <td>SHA-256</td>\n",
-       "      <td>...</td>\n",
-       "      <td>2021-08-23T09:18:43.327Z</td>\n",
+       "      <td>Jane Doe</td>\n",
+       "      <td>https://bluebrain.github.io/nexus/schemas/unco...</td>\n",
+       "      <td>2022-01-16T15:40:36.400Z</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/realms/gi...</td>\n",
        "      <td>False</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/projects/...</td>\n",
        "      <td>1</td>\n",
+       "      <td>https://sandbox.bluebrainnexus.io/v1/projects/...</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
-       "      <td>2021-08-23T09:18:43.327Z</td>\n",
+       "      <td>2022-01-16T15:40:36.400Z</td>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/realms/gi...</td>\n",
        "    </tr>\n",
        "  </tbody>\n",
        "</table>\n",
-       "<p>3 rows × 25 columns</p>\n",
        "</div>"
       ],
       "text/plain": [
-       "                                                  id    type  \\\n",
-       "0  https://sandbox.bluebrainnexus.io/v1/resources...  Person   \n",
-       "1  https://sandbox.bluebrainnexus.io/v1/resources...  Person   \n",
-       "2  https://sandbox.bluebrainnexus.io/v1/resources...  Person   \n",
-       "\n",
-       "                                      _schemaProject distribution.type  \\\n",
-       "0  https://sandbox.bluebrainnexus.io/v1/projects/...      DataDownload   \n",
-       "1  https://sandbox.bluebrainnexus.io/v1/projects/...      DataDownload   \n",
-       "2  https://sandbox.bluebrainnexus.io/v1/projects/...      DataDownload   \n",
+       "                                                  id    type      name  \\\n",
+       "0  https://sandbox.bluebrainnexus.io/v1/resources...  Person  Jane Doe   \n",
+       "1  https://sandbox.bluebrainnexus.io/v1/resources...  Person  Jane Doe   \n",
+       "2  https://sandbox.bluebrainnexus.io/v1/resources...  Person  Jane Doe   \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.contentSize.unitCode  distribution.contentSize.value  \\\n",
-       "0                             bytes                             506   \n",
-       "1                             bytes                             506   \n",
-       "2                             bytes                             506   \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",
+       "                                      _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.digest.algorithm  ...                _createdAt  \\\n",
-       "0                       SHA-256  ...  2021-08-17T11:00:14.662Z   \n",
-       "1                       SHA-256  ...  2021-08-23T09:12:24.049Z   \n",
-       "2                       SHA-256  ...  2021-08-23T09:18:43.327Z   \n",
+       "                 _createdAt  \\\n",
+       "0  2022-01-16T15:13:50.255Z   \n",
+       "1  2022-01-16T15:34:58.885Z   \n",
+       "2  2022-01-16T15:40:36.400Z   \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",
+       "                                          _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",
@@ -1910,10 +1676,15 @@
        "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",
-       "1  https://sandbox.bluebrainnexus.io/v1/projects/...    1   \n",
-       "2  https://sandbox.bluebrainnexus.io/v1/projects/...    1   \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",
+       "                                      _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",
        "                                               _self  \\\n",
        "0  https://sandbox.bluebrainnexus.io/v1/resources...   \n",
@@ -1921,14 +1692,12 @@
        "2  https://sandbox.bluebrainnexus.io/v1/resources...   \n",
        "\n",
        "                 _updatedAt                                         _updatedBy  \n",
-       "0  2021-08-17T11:00:14.662Z  https://sandbox.bluebrainnexus.io/v1/realms/gi...  \n",
-       "1  2021-08-23T09:12:24.049Z  https://sandbox.bluebrainnexus.io/v1/realms/gi...  \n",
-       "2  2021-08-23T09:18:43.327Z  https://sandbox.bluebrainnexus.io/v1/realms/gi...  \n",
-       "\n",
-       "[3 rows x 25 columns]"
+       "0  2022-01-16T15:13:50.255Z  https://sandbox.bluebrainnexus.io/v1/realms/gi...  \n",
+       "1  2022-01-16T15:34:58.885Z  https://sandbox.bluebrainnexus.io/v1/realms/gi...  \n",
+       "2  2022-01-16T15:40:36.400Z  https://sandbox.bluebrainnexus.io/v1/realms/gi...  "
       ]
      },
-     "execution_count": 174,
+     "execution_count": 50,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -1946,19 +1715,19 @@
   },
   {
    "cell_type": "code",
-   "execution_count": null,
+   "execution_count": 51,
    "metadata": {},
    "outputs": [],
    "source": [
     "# Search for resources of type Person and retrieve their ids and names.\n",
     "\n",
     "filters = {\"@type\": \"http://schema.org/Person\"}\n",
-    "resources = forge.search(filters, limit=3, search_endpoint='elastic', debug=True, includes=[\"@id\",\"name\"]) # fields can also be excluded with 'excludes'"
+    "resources = forge.search(filters, limit=3, search_endpoint='elastic', includes=[\"@id\",\"name\"]) # fields can also be excluded with 'excludes'"
    ]
   },
   {
    "cell_type": "code",
-   "execution_count": 194,
+   "execution_count": 52,
    "metadata": {},
    "outputs": [
     {
@@ -1967,7 +1736,7 @@
        "list"
       ]
      },
-     "execution_count": 194,
+     "execution_count": 52,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -1978,7 +1747,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 195,
+   "execution_count": 53,
    "metadata": {},
    "outputs": [
     {
@@ -1987,7 +1756,7 @@
        "3"
       ]
      },
-     "execution_count": 195,
+     "execution_count": 53,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -1998,7 +1767,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 196,
+   "execution_count": 54,
    "metadata": {},
    "outputs": [
     {
@@ -2053,7 +1822,7 @@
        "2  https://sandbox.bluebrainnexus.io/v1/resources...  Jane Doe"
       ]
      },
-     "execution_count": 196,
+     "execution_count": 54,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -2072,7 +1841,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 88,
+   "execution_count": 55,
    "metadata": {},
    "outputs": [],
    "source": [
@@ -2081,7 +1850,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 89,
+   "execution_count": 56,
    "metadata": {},
    "outputs": [
     {
@@ -2090,7 +1859,7 @@
        "list"
       ]
      },
-     "execution_count": 89,
+     "execution_count": 56,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -2101,7 +1870,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 90,
+   "execution_count": 57,
    "metadata": {},
    "outputs": [
     {
@@ -2110,7 +1879,7 @@
        "3"
       ]
      },
-     "execution_count": 90,
+     "execution_count": 57,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -2121,7 +1890,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 91,
+   "execution_count": 58,
    "metadata": {},
    "outputs": [
     {
@@ -2147,7 +1916,6 @@
        "      <th></th>\n",
        "      <th>id</th>\n",
        "      <th>type</th>\n",
-       "      <th>_schemaProject</th>\n",
        "      <th>agent.type</th>\n",
        "      <th>agent.gender.id</th>\n",
        "      <th>agent.gender.type</th>\n",
@@ -2171,7 +1939,6 @@
        "      <th>0</th>\n",
        "      <td>https://kg.example.ch/associations/123</td>\n",
        "      <td>Association</td>\n",
-       "      <td>https://sandbox.bluebrainnexus.io/v1/projects/...</td>\n",
        "      <td>Person</td>\n",
        "      <td>http://purl.obolibrary.org/obo/PATO_0000383</td>\n",
        "      <td>LabeledOntologyEntity</td>\n",
@@ -2193,7 +1960,6 @@
        "      <th>1</th>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
        "      <td>Association</td>\n",
-       "      <td>https://sandbox.bluebrainnexus.io/v1/projects/...</td>\n",
        "      <td>Person</td>\n",
        "      <td>http://purl.obolibrary.org/obo/PATO_0000384</td>\n",
        "      <td>LabeledOntologyEntity</td>\n",
@@ -2215,7 +1981,6 @@
        "      <th>2</th>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
        "      <td>Association</td>\n",
-       "      <td>https://sandbox.bluebrainnexus.io/v1/projects/...</td>\n",
        "      <td>Person</td>\n",
        "      <td>NaN</td>\n",
        "      <td>NaN</td>\n",
@@ -2238,15 +2003,10 @@
        "</div>"
       ],
       "text/plain": [
-       "                                                  id         type  \\\n",
-       "0             https://kg.example.ch/associations/123  Association   \n",
-       "1  https://sandbox.bluebrainnexus.io/v1/resources...  Association   \n",
-       "2  https://sandbox.bluebrainnexus.io/v1/resources...  Association   \n",
-       "\n",
-       "                                      _schemaProject agent.type  \\\n",
-       "0  https://sandbox.bluebrainnexus.io/v1/projects/...     Person   \n",
-       "1  https://sandbox.bluebrainnexus.io/v1/projects/...     Person   \n",
-       "2  https://sandbox.bluebrainnexus.io/v1/projects/...     Person   \n",
+       "                                                  id         type agent.type  \\\n",
+       "0             https://kg.example.ch/associations/123  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",
@@ -2294,7 +2054,7 @@
        "2                         NaN                  NaN                   NaN  "
       ]
      },
-     "execution_count": 91,
+     "execution_count": 58,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -2369,7 +2129,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 96,
+   "execution_count": 60,
    "metadata": {},
    "outputs": [],
    "source": [
@@ -2379,7 +2139,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 97,
+   "execution_count": 61,
    "metadata": {},
    "outputs": [],
    "source": [
@@ -2389,7 +2149,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 98,
+   "execution_count": 62,
    "metadata": {},
    "outputs": [],
    "source": [
@@ -2398,7 +2158,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 99,
+   "execution_count": 63,
    "metadata": {},
    "outputs": [
     {
@@ -2416,7 +2176,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 124,
+   "execution_count": 64,
    "metadata": {
     "scrolled": true
    },
@@ -2573,7 +2333,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 101,
+   "execution_count": 65,
    "metadata": {},
    "outputs": [],
    "source": [
@@ -2589,7 +2349,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 102,
+   "execution_count": 66,
    "metadata": {},
    "outputs": [],
    "source": [
@@ -2598,7 +2358,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 103,
+   "execution_count": 67,
    "metadata": {},
    "outputs": [
     {
@@ -2607,7 +2367,7 @@
        "list"
       ]
      },
-     "execution_count": 103,
+     "execution_count": 67,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -2618,7 +2378,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 104,
+   "execution_count": 68,
    "metadata": {},
    "outputs": [
     {
@@ -2627,7 +2387,7 @@
        "3"
       ]
      },
-     "execution_count": 104,
+     "execution_count": 68,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -2638,7 +2398,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 105,
+   "execution_count": 69,
    "metadata": {},
    "outputs": [
     {
@@ -2647,7 +2407,7 @@
        "kgforge.core.resource.Resource"
       ]
      },
-     "execution_count": 105,
+     "execution_count": 69,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -2658,7 +2418,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 106,
+   "execution_count": 70,
    "metadata": {},
    "outputs": [
     {
@@ -2690,12 +2450,12 @@
        "    <tr>\n",
        "      <th>0</th>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
-       "      <td>John Smith</td>\n",
+       "      <td>Jane Doe</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1</th>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
-       "      <td>Jane Doe</td>\n",
+       "      <td>John Smith</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>2</th>\n",
@@ -2708,12 +2468,12 @@
       ],
       "text/plain": [
        "                                                  id        name\n",
-       "0  https://sandbox.bluebrainnexus.io/v1/resources...  John Smith\n",
-       "1  https://sandbox.bluebrainnexus.io/v1/resources...    Jane Doe\n",
+       "0  https://sandbox.bluebrainnexus.io/v1/resources...    Jane Doe\n",
+       "1  https://sandbox.bluebrainnexus.io/v1/resources...  John Smith\n",
        "2  https://sandbox.bluebrainnexus.io/v1/resources...  John Smith"
       ]
      },
-     "execution_count": 106,
+     "execution_count": 70,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -2731,7 +2491,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 107,
+   "execution_count": 71,
    "metadata": {},
    "outputs": [
     {
@@ -2763,6 +2523,7 @@
       "           nsg:contribution/prov:agent ?contributor.\n",
       "           ?contributor schema:name ?name.\n",
       "       }\n",
+      "     LIMIT 3\n",
       "\n"
      ]
     }
@@ -2777,12 +2538,12 @@
    "source": [
     "### Full SPARQL query\n",
     "\n",
-    "regular SPARQL query can also be provided."
+    "Regular SPARQL query can also be provided. When 'rewrite' is set to False, the limit and offset arguments superseed any in query limit or offset values."
    ]
   },
   {
    "cell_type": "code",
-   "execution_count": 108,
+   "execution_count": 78,
    "metadata": {},
    "outputs": [],
    "source": [
@@ -2810,21 +2571,22 @@
     "       nsg:contribution/prov:agent ?contributor.\n",
     "       ?contributor schema:name ?name.\n",
     "   }\n",
+    "   ORDER BY ?id\n",
     "\"\"\""
    ]
   },
   {
    "cell_type": "code",
-   "execution_count": 109,
+   "execution_count": 79,
    "metadata": {},
    "outputs": [],
    "source": [
-    "resources = forge.sparql(query, limit=3)"
+    "resources = forge.sparql(query, rewrite=False, limit=3) # it is recommended to set 'rewrite' to 'False' to prevent the sparql query rewriting."
    ]
   },
   {
    "cell_type": "code",
-   "execution_count": 110,
+   "execution_count": 80,
    "metadata": {},
    "outputs": [
     {
@@ -2833,7 +2595,7 @@
        "list"
       ]
      },
-     "execution_count": 110,
+     "execution_count": 80,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -2844,7 +2606,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 111,
+   "execution_count": 81,
    "metadata": {},
    "outputs": [
     {
@@ -2853,7 +2615,7 @@
        "3"
       ]
      },
-     "execution_count": 111,
+     "execution_count": 81,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -2864,7 +2626,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 112,
+   "execution_count": 82,
    "metadata": {},
    "outputs": [
     {
@@ -2873,7 +2635,7 @@
        "kgforge.core.resource.Resource"
       ]
      },
-     "execution_count": 112,
+     "execution_count": 82,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -2884,7 +2646,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 113,
+   "execution_count": 83,
    "metadata": {},
    "outputs": [
     {
@@ -2926,7 +2688,7 @@
        "    <tr>\n",
        "      <th>2</th>\n",
        "      <td>https://sandbox.bluebrainnexus.io/v1/resources...</td>\n",
-       "      <td>John Smith</td>\n",
+       "      <td>Jane Doe</td>\n",
        "    </tr>\n",
        "  </tbody>\n",
        "</table>\n",
@@ -2936,10 +2698,10 @@
        "                                                  id        name\n",
        "0  https://sandbox.bluebrainnexus.io/v1/resources...  John Smith\n",
        "1  https://sandbox.bluebrainnexus.io/v1/resources...    Jane Doe\n",
-       "2  https://sandbox.bluebrainnexus.io/v1/resources...  John Smith"
+       "2  https://sandbox.bluebrainnexus.io/v1/resources...    Jane Doe"
       ]
      },
-     "execution_count": 113,
+     "execution_count": 83,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -2966,7 +2728,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 125,
+   "execution_count": 84,
    "metadata": {},
    "outputs": [],
    "source": [
@@ -2976,7 +2738,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 126,
+   "execution_count": 85,
    "metadata": {},
    "outputs": [],
    "source": [
@@ -2986,7 +2748,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 127,
+   "execution_count": 86,
    "metadata": {},
    "outputs": [],
    "source": [
@@ -2995,7 +2757,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 128,
+   "execution_count": 87,
    "metadata": {},
    "outputs": [
     {
@@ -3013,7 +2775,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 129,
+   "execution_count": 88,
    "metadata": {},
    "outputs": [
     {
@@ -3166,7 +2928,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 155,
+   "execution_count": 101,
    "metadata": {},
    "outputs": [],
    "source": [
@@ -3189,7 +2951,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 156,
+   "execution_count": 102,
    "metadata": {},
    "outputs": [],
    "source": [
@@ -3198,7 +2960,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 157,
+   "execution_count": 103,
    "metadata": {},
    "outputs": [
     {
@@ -3207,7 +2969,7 @@
        "list"
       ]
      },
-     "execution_count": 157,
+     "execution_count": 103,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -3218,7 +2980,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 158,
+   "execution_count": 104,
    "metadata": {},
    "outputs": [
     {
@@ -3227,7 +2989,7 @@
        "3"
       ]
      },
-     "execution_count": 158,
+     "execution_count": 104,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -3238,7 +3000,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 159,
+   "execution_count": 178,
    "metadata": {},
    "outputs": [
     {
@@ -3247,7 +3009,7 @@
        "kgforge.core.resource.Resource"
       ]
      },
-     "execution_count": 159,
+     "execution_count": 178,
      "metadata": {},
      "output_type": "execute_result"
     }
@@ -3258,7 +3020,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 160,
+   "execution_count": 179,
    "metadata": {},
    "outputs": [
     {
@@ -3318,7 +3080,7 @@
        "2               H16.06.009.01.01.15.01  "
       ]
      },
-     "execution_count": 160,
+     "execution_count": 179,
      "metadata": {},
      "output_type": "execute_result"
     }
diff --git a/kgforge/core/archetypes/store.py b/kgforge/core/archetypes/store.py
index c564b2de..a0982bc3 100644
--- a/kgforge/core/archetypes/store.py
+++ b/kgforge/core/archetypes/store.py
@@ -360,18 +360,36 @@ def search(
         not_supported()
 
     def sparql(
-        self, query: str, debug: bool, limit: int, offset: int = None
+        self, query: str, debug: bool, limit: int = None, offset: int = None, **params
     ) -> List[Resource]:
+        rewrite = params.get("rewrite", True)
         qr = (
-            rewrite_sparql(query, self.model_context)
-            if self.model_context is not None
+            rewrite_sparql(query, self.model_context, self.service.metadata_context)
+            if self.model_context is not None and rewrite
             else query
         )
+        limit_in_query = bool(re.search(r" LIMIT \d+", qr, flags=re.IGNORECASE))
+        offset_in_query = bool(re.search(r" OFFSET \d+", qr, flags=re.IGNORECASE))
+        if limit:
+            s_limit = f" LIMIT {limit}"
+            if limit_in_query:
+                qr = re.sub(r" LIMIT \d+", s_limit, qr, flags=re.IGNORECASE)
+            else:
+                qr = f"{qr} {s_limit}"
+        elif not limit_in_query:
+            qr = f"{qr} LIMIT 100"
+
+        if offset:
+            s_offset = f" OFFSET {offset}"
+            if offset_in_query:
+                qr = re.sub(r" OFFSET \d+", s_offset, qr, flags=re.IGNORECASE)
+            else:
+                qr = f"{qr} {s_offset}"
         if debug:
             self._debug_query(qr)
-        return self._sparql(qr, limit, offset)
+        return self._sparql(qr, limit, offset, **params)
 
-    def _sparql(self, query: str, limit: int, offset: int) -> List[Resource]:
+    def _sparql(self, query: str, limit: int, offset: int, **params) -> List[Resource]:
         # POLICY Should notify of failures with exception QueryingError including a message.
         # POLICY Resource _store_metadata should not be set (default is None).
         # POLICY Resource _synchronized should not be set (default is False).
@@ -447,17 +465,23 @@ def _debug_query(query):
         print()
 
 
-def rewrite_sparql(query: str, context: Context) -> str:
+def rewrite_sparql(query: str, context: Context, metadata_context) -> str:
     """Rewrite local property and type names from Model.template() as IRIs.
 
     Local names are mapped to IRIs by using a JSON-LD context, i.e. { "@context": { ... }} from a kgforge.core.commons.Context.
     In the case of contexts using prefixed names, prefixes are added to the SPARQL query prologue.
     In the case of non available contexts and vocab then the query is returned unchanged.
     """
-    ctx = {
+    ctx = {}
+    if metadata_context and metadata_context.document:
+        ctx.update({
+            k: v["@id"] if isinstance(v, Dict) else v
+            for k, v in metadata_context.document["@context"].items()
+        })
+    ctx.update({
         k: v["@id"] if isinstance(v, Dict) else v
         for k, v in context.document["@context"].items()
-    }
+    })
     prefixes = context.prefixes
     has_prefixes = prefixes is not None and len(prefixes.keys()) > 0
     if ctx.get("type") == "@type":
@@ -480,7 +504,7 @@ def replace(match: Match) -> str:
             if v is None:
                 raise QueryingError(
                     f"Failed to construct a valid SPARQL query: add '{m4}'"
-                    f" or define an @vocab in the configured JSON-LD context."
+                    f", define an @vocab in the configured JSON-LD context or provide a fully correct SPARQL query."
                 )
             m5 = match.group(5)
             if "//" in v:
diff --git a/kgforge/core/commons/__init__.py b/kgforge/core/commons/__init__.py
index dcdedb1c..0c5a6f19 100644
--- a/kgforge/core/commons/__init__.py
+++ b/kgforge/core/commons/__init__.py
@@ -13,3 +13,4 @@
 # along with Blue Brain Nexus Forge. If not, see <https://choosealicense.com/licenses/lgpl-3.0/>.
 
 from .context import Context
+from .parser import _parse_type
diff --git a/kgforge/core/commons/es_query_builder.py b/kgforge/core/commons/es_query_builder.py
index b4cb62c1..3da6b2c4 100644
--- a/kgforge/core/commons/es_query_builder.py
+++ b/kgforge/core/commons/es_query_builder.py
@@ -382,6 +382,7 @@ def _wrap_in_nested_query(path: str, query: Dict):
     return elasticsearch_dsl.query.Nested(path=path, query=query)
 
 
+# TODO: reuse kgforge.core.commons.parser._parse_type
 def _detect_mapping_type(value: Any):
 
     try:
diff --git a/kgforge/core/commons/parser.py b/kgforge/core/commons/parser.py
new file mode 100644
index 00000000..33d873ac
--- /dev/null
+++ b/kgforge/core/commons/parser.py
@@ -0,0 +1,42 @@
+#
+# Blue Brain Nexus Forge is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Blue Brain Nexus Forge is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with Blue Brain Nexus Forge. If not, see <https://choosealicense.com/licenses/lgpl-3.0/>.
+from typing import Any
+
+import dateutil
+import datetime
+from dateutil.parser import ParserError
+
+
+def _parse_type(value: Any):
+
+    try:
+        # integer
+        if str(value).isnumeric():
+            return int
+        # bool
+        if value is True or value is False:
+            return bool
+        # double
+        if float(value):
+            return float
+    except ValueError as ve:
+        pass
+    except TypeError as te:
+        pass
+    try:
+        # Date
+        if isinstance(dateutil.parser.parse(str(value)), datetime.datetime):
+            return datetime.datetime
+    except ParserError as pe:
+        return str
diff --git a/kgforge/core/forge.py b/kgforge/core/forge.py
index a394ad2e..90919523 100644
--- a/kgforge/core/forge.py
+++ b/kgforge/core/forge.py
@@ -569,19 +569,21 @@ def sparql(
         self,
         query: str,
         debug: bool = False,
-        limit: int = 100,
+        limit: Optional[int] = None,
         offset: Optional[int] = None,
+        **params
     ) -> List[Resource]:
         """
         Search for resources using a SPARQL query. See SPARQL docs: https://www.w3.org/TR/sparql11-query.
 
         :param query: a SPARQL query
         :param debug: a boolean
-        :param limit: the number of resources to retrieve
-        :param offset: how many results to skip from the first one
+        :param limit: the number of resources to retrieve. Default to 100. If provided in query limit will be replaced
+        :param offset: how many results to skip from the first one. If provided in query offset will be replaced
+        :param params: a dictionary of parameters. Supported params are: rewrite (whether to rewrite the sparql query or run it as is)
         :return: List[Resource]
         """
-        return self._store.sparql(query, debug, limit, offset)
+        return self._store.sparql(query, debug, limit, offset, **params)
 
     @catch
     def elastic(
diff --git a/kgforge/specializations/stores/bluebrain_nexus.py b/kgforge/specializations/stores/bluebrain_nexus.py
index 9b5f4f24..2f7b7642 100644
--- a/kgforge/specializations/stores/bluebrain_nexus.py
+++ b/kgforge/specializations/stores/bluebrain_nexus.py
@@ -36,7 +36,7 @@
 from pyld import jsonld
 from rdflib import Graph
 from rdflib.plugins.sparql.parser import Query
-
+from datetime import datetime
 from requests import HTTPError
 
 from kgforge.core import Resource
@@ -55,6 +55,7 @@
 )
 from kgforge.core.commons.execution import run, not_supported
 from kgforge.core.commons.files import is_valid_url
+from kgforge.core.commons.parser import _parse_type
 from kgforge.core.conversions.rdf import as_jsonld, from_jsonld
 from kgforge.core.wrappings.dict import DictWrapper
 from kgforge.core.wrappings.paths import Filter, create_filters_from_dict
@@ -62,14 +63,15 @@
 from kgforge.specializations.mappings import DictionaryMapping
 from kgforge.specializations.stores.nexus.service import BatchAction, Service
 
-
 class CategoryDataType(Enum):
+    DATETIME = "datetime"
     NUMBER = "number"
     BOOLEAN = "boolean"
     LITERAL = "literal"
 
 
 type_map = {
+    datetime: CategoryDataType.DATETIME,
     str: CategoryDataType.LITERAL,
     bool: CategoryDataType.BOOLEAN,
     int: CategoryDataType.NUMBER,
@@ -78,6 +80,7 @@ class CategoryDataType(Enum):
 }
 
 format_type = {
+    CategoryDataType.DATETIME: lambda x: f'"{x}"^^xsd:dateTime',
     CategoryDataType.NUMBER: lambda x: x,
     CategoryDataType.LITERAL: lambda x: f'"{x}"',
     CategoryDataType.BOOLEAN: lambda x: "true" if x is True else "false",
@@ -754,11 +757,7 @@ def search(
                 json.dumps(query), debug=debug, limit=limit, offset=offset
             )
 
-    def _sparql(self, query: str, limit: int, offset: int = None) -> List[Resource]:
-
-        s_offset = "" if offset is None else f"OFFSET {offset}"
-        s_limit = "" if limit is None else f"LIMIT {limit}"
-        query = f"{query} {s_limit} {s_offset}"
+    def _sparql(self, query: str, limit: int, offset: int = None, **params) -> List[Resource]:
         try:
             response = requests.post(
                 self.service.sparql_endpoint["endpoint"],
@@ -944,32 +943,36 @@ def build_sparql_query_statements(context: Context, *conditions) -> Tuple[List,
             property_path = "/".join(minus_last_path)
         else:
             property_path = "/".join(f.path)
-        if (
-            last_path in ["type", "@type"]
-            or last_path in ["id", "@id"]
-            or (last_term is not None and last_term.type == "@id")
-        ):
-            if f.operator == "__eq__":
-                statements.append(f"{property_path} {_box_value_as_full_iri(f.value)}")
-            elif f.operator == "__ne__":
-                statements.append(f"{property_path} ?v{index}")
-                filters.append(f"FILTER(?v{index} != {f.value})")
-            else:
-                raise NotImplementedError(
-                    f"operator '{f.operator}' is not supported in this query"
-                )
-        else:
-            value_type = type_map[type(f.value)]
-            value = format_type[value_type](f.value)
-            if value_type is CategoryDataType.LITERAL:
-                statements.append(f"{property_path} ?v{index}")
-                filters.append(f"FILTER(?v{index} = {_box_value_as_full_iri(value)})")
+        try:
+            if (
+                last_path in ["type", "@type"]
+                or last_path in ["id", "@id"]
+                or (last_term is not None and last_term.type == "@id")
+            ):
+                if f.operator == "__eq__":
+                    statements.append(f"{property_path} {_box_value_as_full_iri(f.value)}")
+                elif f.operator == "__ne__":
+                    statements.append(f"{property_path} ?v{index}")
+                    filters.append(f"FILTER(?v{index} != {f.value})")
+                else:
+                    raise NotImplementedError(
+                        f"supported operators are '==' and '!=' when filtering by type or id."
+                    )
             else:
-                statements.append(f"{property_path} ?v{index}")
-                filters.append(
-                    f"FILTER(?v{index} {sparql_operator_map[f.operator]} {_box_value_as_full_iri(value)})"
-                )
-
+                value_type = type_map[_parse_type(f.value)]
+                value = format_type[value_type](f.value)
+                if value_type is CategoryDataType.LITERAL:
+                    if f.operator not in ["__eq__", "__ne__"]:
+                        raise NotImplementedError(f"supported operators are '==' and '!=' when filtering with a str.")
+                    statements.append(f"{property_path} ?v{index}")
+                    filters.append(f"FILTER(?v{index} = {_box_value_as_full_iri(value)})")
+                else:
+                    statements.append(f"{property_path} ?v{index}")
+                    filters.append(
+                        f"FILTER(?v{index} {sparql_operator_map[f.operator]} {_box_value_as_full_iri(value)})"
+                    )
+        except NotImplementedError as nie:
+            raise ValueError(f"Operator '{sparql_operator_map[f.operator]}' is not supported with the value '{f.value}': {str(nie)}")
     return statements, filters
 
 


Test patch:
diff --git a/tests/core/archetypes/test_store.py b/tests/core/archetypes/test_store.py
index 46c3f279..ab09bfcb 100644
--- a/tests/core/archetypes/test_store.py
+++ b/tests/core/archetypes/test_store.py
@@ -77,31 +77,33 @@
     ("SELECT DISTINCT ?x WHERE { ?id propertyNotInContext/name/anotherPropertyNotInContext ?x }",
      "\nSELECT DISTINCT ?x WHERE { ?id :propertyNotInContext/schema:name/:anotherPropertyNotInContext ?x }"),
     ("SELECT ?x WHERE { Graph ?g { ?id propertyNotInContext/name/anotherPropertyNotInContext ?x }}",
-     "\nSELECT ?x WHERE { Graph ?g { ?id :propertyNotInContext/schema:name/:anotherPropertyNotInContext ?x }}")
+     "\nSELECT ?x WHERE { Graph ?g { ?id :propertyNotInContext/schema:name/:anotherPropertyNotInContext ?x }}"),
+    ("SELECT * WHERE { <http://exaplpe.org/1234> a TypeNotInContext, AnotherNotTypeInContext, Person; deprecated false.}",
+     "\nSELECT * WHERE { <http://exaplpe.org/1234> a :TypeNotInContext, :AnotherNotTypeInContext, schema:Person; <https://store.net/vocabulary/deprecated> false.}")
 ]
 
 
 @pytest.mark.parametrize("query, expected", form_store_metadata_combinations)
-def test_rewrite_sparql(query, expected):
+def test_rewrite_sparql(query, expected, metadata_context):
     prefixes_string_vocab = "\n".join([prefixes_string, f"PREFIX : <http://example.org/vocab/>"])
     context_object = Context(document=context)
-    result = rewrite_sparql(query, context_object)
+    result = rewrite_sparql(query, context_object, metadata_context=metadata_context)
     assert result == prefixes_string_vocab + expected
 
 
-def test_rewrite_sparql_unknownterm_missing_vocab(custom_context):
+def test_rewrite_sparql_unknownterm_missing_vocab(custom_context, metadata_context):
     context_object = Context(document=custom_context)
     assert not context_object.has_vocab()
     with pytest.raises(QueryingError):
         query = "SELECT ?x WHERE { Graph ?g { ?id propertyNotInContext/name/anotherPropertyNotInContext ?x }}"
-        rewrite_sparql(query, context_object)
+        rewrite_sparql(query, context_object, metadata_context)
 
 
-def test_rewrite_sparql_missingvocab(custom_context):
+def test_rewrite_sparql_missingvocab(custom_context, metadata_context):
     query = "SELECT ?name WHERE { <http://exaplpe.org/1234> name ?name }"
     expected = "PREFIX foaf: <http://xmlns.com/foaf/0.1/>\nSELECT ?name WHERE { <http://exaplpe.org/1234> foaf:name ?name }"
     context_object = Context(document=custom_context)
-    result = rewrite_sparql(query, context_object)
+    result = rewrite_sparql(query, context_object, metadata_context)
     assert result == expected
 
 
diff --git a/tests/specializations/stores/test_bluebrain_nexus.py b/tests/specializations/stores/test_bluebrain_nexus.py
index e9627387..aa4b1dc1 100644
--- a/tests/specializations/stores/test_bluebrain_nexus.py
+++ b/tests/specializations/stores/test_bluebrain_nexus.py
@@ -216,6 +216,11 @@ def context(self):
                 (["address/postalCode ?v0"], ["FILTER(?v0 <= 50070)"]),
                 id="number-le",
             ),
+            pytest.param(
+                (Filter(["createdAt"], "__ge__", "2020-10-20T13:53:22.880Z"),),
+                (["createdAt ?v0"], ['FILTER(?v0 >= "2020-10-20T13:53:22.880Z"^^xsd:dateTime)']),
+                id="datetime-ge",
+            ),
             pytest.param(
                 (Filter(["deprecated"], "__eq__", False),),
                 (["deprecated ?v0"], ["FILTER(?v0 = false)"]),
@@ -282,6 +287,19 @@ def test_filter_to_query_statements(self, context, filters, expected):
         statements = build_sparql_query_statements(context, filters)
         assert statements == expected
 
+    @pytest.mark.parametrize(
+        "filters",
+        [
+            pytest.param(
+                (Filter(["agent", "name"], "__le__", "Allen Institute"),),
+                id="range_query_str",
+            )
+        ]
+    )
+    def test_filter_to_query_statements_exceptions(self, context, filters):
+        with pytest.raises(ValueError):
+            build_sparql_query_statements(context, filters)
+
     def test_create_select_query(self):
         statements = f"?id type <https://github.com/BlueBrain/nexus-forge>"
         query = _create_select_query(statements, distinct=False, search_in_graph=True)