diff --git a/.gitignore b/.gitignore
index bc6cbb7..69c3c06 100644
--- a/.gitignore
+++ b/.gitignore
@@ -27,11 +27,7 @@ var/
.DS_Store
# Tests
-test/virtuoso-test-data/
-test/virtuoso-meta-data/database/virtuoso.lck
-test/virtuoso-meta-data/database/virtuoso.log
-test/virtuoso-meta-data/index_entities.txt
-test/qlever-index-data/oc-index-test.server-log.txt
+test/qlever-data/oc-test.server-log.txt
.coverage
# uv
diff --git a/Dockerfile b/Dockerfile
index 0fc0977..fe80f45 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -6,7 +6,7 @@ FROM python:3.11-slim
ENV BASE_URL="api.opencitations.net" \
LOG_DIR="/mnt/log_dir/oc_api" \
SPARQL_ENDPOINT_INDEX="http://qlever-service.default.svc.cluster.local:7011" \
- SPARQL_ENDPOINT_META="http://virtuoso-service.default.svc.cluster.local:8890/sparql" \
+ SPARQL_ENDPOINT_META="http://meta-qlever-service.default.svc.cluster.local:7011" \
SYNC_ENABLED="true"
# Ensure Python output is unbuffered
diff --git a/README.md b/README.md
index fa796b3..df20f23 100644
--- a/README.md
+++ b/README.md
@@ -37,7 +37,7 @@ For instance:
BASE_URL=api.opencitations.net
LOG_DIR=/home/dir/log/
SPARQL_ENDPOINT_INDEX=http://qlever-service.default.svc.cluster.local:7011
-SPARQL_ENDPOINT_META=http://virtuoso-service.default.svc.cluster.local:8890/sparql
+SPARQL_ENDPOINT_META=http://meta-qlever-service.default.svc.cluster.local:7011
SYNC_ENABLED=true
# Redis Configuration
@@ -127,7 +127,7 @@ VERSION=$(grep -m1 '^version' pyproject.toml | cut -d'"' -f2)
docker build -t opencitations/oc_api:$VERSION .
docker run -p 8080:8080 \
-e SPARQL_ENDPOINT_INDEX=http://qlever:7011 \
- -e SPARQL_ENDPOINT_META=http://virtuoso:8890/sparql \
+ -e SPARQL_ENDPOINT_META=http://meta-qlever:7011 \
opencitations/oc_api:$VERSION
```
@@ -141,7 +141,7 @@ You can customize the Gunicorn server configuration by modifying the `gunicorn.c
### Running Tests Locally
-The tests require Docker. Pytest fixtures in `test/conftest.py` automatically start and stop the QLever and Virtuoso containers.
+The tests require Docker. Pytest fixtures in `test/conftest.py` automatically start and stop the QLever container.
1. Install dependencies:
```bash
diff --git a/api_oc.py b/api_oc.py
index f1affaa..cef8f5b 100644
--- a/api_oc.py
+++ b/api_oc.py
@@ -108,11 +108,12 @@
skgif_api_manager = APIManager(
c["api_skgif"], endpoint_override=env_config["sparql_endpoint_meta"]
)
-for config in skgif_api_manager.all_conf.values():
- config["sources_map"] = {
- "meta": env_config["sparql_endpoint_meta"],
- "index": env_config["sparql_endpoint_index"],
- }
+for manager in (index_api_manager, index_api_manager_v2, skgif_api_manager):
+ for config in manager.all_conf.values():
+ config["sources_map"] = {
+ "meta": env_config["sparql_endpoint_meta"],
+ "index": env_config["sparql_endpoint_index"],
+ }
skgif_doc_manager = HTMLDocumentationHandler(skgif_api_manager)
skgif_openapi_manager = OpenAPIDocumentationHandler(skgif_api_manager)
diff --git a/conf.json b/conf.json
index 0158bfd..8347274 100644
--- a/conf.json
+++ b/conf.json
@@ -4,7 +4,7 @@
"oc_services_templates": "https://github.com/opencitations/oc_services_templates",
"base_url": " api.opencitations.net",
"sparql_endpoint_index": "http://qlever-service.default.svc.cluster.local:7011",
- "sparql_endpoint_meta": "http://virtuoso-service.default.svc.cluster.local:8890/sparql",
+ "sparql_endpoint_meta": "http://meta-qlever-service.default.svc.cluster.local:7011",
"api_index": [ "src/api/index_v1.hf" ],
"api_index_v2": [ "src/api/index_v2.hf" ],
"api_meta": ["src/api/meta_v1.hf"],
diff --git a/pyproject.toml b/pyproject.toml
index c18030b..bb466e5 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -4,7 +4,7 @@
[project]
name = "oc-api"
-version = "4.0.1"
+version = "4.2.0"
description = "OpenCitations API"
authors = [
{name = "Mario Petrella", email = "mario.petrella@unibo.it"},
@@ -20,7 +20,7 @@ dependencies = [
"gunicorn>=22.0.0",
"idna>=3.15",
"python-dateutil>=2.9.0.post0",
- "ramose>=2.9.1",
+ "ramose>=2.10.1",
"rdflib>=6.1.1",
"redis>=7.0.1",
"requests>=2.32.4",
diff --git a/src/api/index_v1.hf b/src/api/index_v1.hf
index 20a88f6..a093f6f 100644
--- a/src/api/index_v1.hf
+++ b/src/api/index_v1.hf
@@ -26,13 +26,15 @@ get(API_CALL, headers=HTTP_HEADERS)
#contacts [contact@opencitations.net](mailto:contact@opencitations.net)
#license This document is licensed with a [Creative Commons Attribution 4.0 International License](https://creativecommons.org/licenses/by/4.0/legalcode), while the REST API itself has been created using [RAMOSE](https://github.com/opencitations/ramose), the *Restful API Manager Over SPARQL Endpoints* created by [Silvio Peroni](https://orcid.org/0000-0003-0530-4305), which is licensed with an [ISC license](https://opensource.org/licenses/ISC).
#endpoint http://qlever-service.default.svc.cluster.local:7011
+#sources meta=http://meta-qlever-service.default.svc.cluster.local:7011;index=http://qlever-service.default.svc.cluster.local:7011
#method post
#addon indexapi_v1
#url /citation/{oci}
#type operation
#oci str([0-9]+-[0-9]+)
-#postprocess citations_info(oci,citing,cited)
+#preprocess oci_search(oci)
+#postprocess citations_info()
#method get
#description This operation retrieves the citation metadata for the citation identified by the input Open Citation Identifier (OCI).
@@ -63,21 +65,89 @@ The values of all the fields are prefixed with `[index name] => `, so as to clea
"author_sc": "no"
}
]
-#field_type str(oci) str(citing) str(cited)
+#field_type str(oci) str(citing) str(cited) datetime(creation) duration(timespan) str(journal_sc) str(author_sc)
#sparql PREFIX cito:
-SELECT ?oci ?citing ?cited
-WHERE {
- VALUES ?oci {} .
- ?oci cito:hasCitingEntity ?citing .
- ?oci cito:hasCitedEntity ?cited .
+SELECT ?oci ?citing_br ?cited_br WHERE {
+ [[oci]]
+ ?citation cito:hasCitingEntity ?citing_br ;
+ cito:hasCitedEntity ?cited_br .
+ BIND(STRAFTER(STR(?citation), "https://w3id.org/oc/index/ci/") AS ?oci)
+}
+@@with meta
+@@join ?citing_br ?citing_br
+@@values ?citing_br batch_size=10000 workers=8
+PREFIX datacite:
+PREFIX literal:
+PREFIX prism:
+SELECT ?citing_br (GROUP_CONCAT(DISTINCT ?id; SEPARATOR=" __ ") AS ?citing_ids) (MIN(STR(?date)) AS ?citing_date) WHERE {
+ ?citing_br datacite:hasIdentifier ?identifier .
+ ?identifier datacite:usesIdentifierScheme ?scheme ;
+ literal:hasLiteralValue ?value .
+ BIND(CONCAT(STRAFTER(STR(?scheme), "http://purl.org/spar/datacite/"), ":", ?value) AS ?id)
+ OPTIONAL { ?citing_br prism:publicationDate ?date }
+}
+GROUP BY ?citing_br
+@@with meta
+@@join ?cited_br ?cited_br
+@@values ?cited_br
+PREFIX datacite:
+PREFIX literal:
+PREFIX prism:
+SELECT ?cited_br (GROUP_CONCAT(DISTINCT ?id; SEPARATOR=" __ ") AS ?cited_ids) (MIN(STR(?date)) AS ?cited_date) WHERE {
+ ?cited_br datacite:hasIdentifier ?identifier .
+ ?identifier datacite:usesIdentifierScheme ?scheme ;
+ literal:hasLiteralValue ?value .
+ BIND(CONCAT(STRAFTER(STR(?scheme), "http://purl.org/spar/datacite/"), ":", ?value) AS ?id)
+ OPTIONAL { ?cited_br prism:publicationDate ?date }
+}
+GROUP BY ?cited_br
+@@join ?oci ?oci type=left
+@@values ?citing_br batch_size=10000 workers=8
+PREFIX datacite:
+PREFIX literal:
+PREFIX frbr:
+PREFIX fabio:
+PREFIX pro:
+SELECT DISTINCT ?oci ("yes" AS ?same_journal) WHERE {
+ {
+ SELECT ?cited_br ?journal WHERE {
+ [[oci]]
+ ?cited_br a fabio:JournalArticle ;
+ frbr:partOf+ ?journal .
+ ?journal a fabio:Journal .
+ }
+ }
+ ?citing_br a fabio:JournalArticle ;
+ frbr:partOf+ ?journal .
+ BIND(CONCAT(STRAFTER(STR(?citing_br), "https://w3id.org/oc/meta/br/"), "-", STRAFTER(STR(?cited_br), "https://w3id.org/oc/meta/br/")) AS ?oci)
+}
+@@join ?oci ?oci type=left
+@@values ?citing_br batch_size=10000 workers=8
+PREFIX datacite:
+PREFIX literal:
+PREFIX frbr:
+PREFIX fabio:
+PREFIX pro:
+SELECT DISTINCT ?oci ("yes" AS ?same_author) WHERE {
+ {
+ SELECT ?cited_br ?author WHERE {
+ [[oci]]
+ ?cited_br pro:isDocumentContextFor ?cited_role .
+ ?cited_role pro:withRole pro:author ;
+ pro:isHeldBy ?author .
+ }
+ }
+ ?citing_role pro:isHeldBy ?author ;
+ pro:withRole pro:author .
+ ?citing_br pro:isDocumentContextFor ?citing_role .
+ BIND(CONCAT(STRAFTER(STR(?citing_br), "https://w3id.org/oc/meta/br/"), "-", STRAFTER(STR(?cited_br), "https://w3id.org/oc/meta/br/")) AS ?oci)
}
-LIMIT 50000
#url /citation-count/{doi}
#type operation
#doi str(10\..+)
-#preprocess lower(doi) --> id2omids(doi)
-#postprocess count_unique_cits(oci,citing,cited)
+#preprocess lower(doi) --> cited_search(doi)
+#postprocess count_groups(citing)
#method get
#description This operation retrieves the number of incoming citations to the bibliographic entity identified by the input DOI.
@@ -91,20 +161,41 @@ The field returned by this operation is:
"count": "32"
}
]
-#sparql PREFIX cito:
-SELECT ?oci ?citing ?cited
-WHERE {
- VALUES ?cited {[[doi]]}
- ?oci cito:hasCitedEntity ?cited .
- ?oci cito:hasCitingEntity ?citing .
+#sparql @@with meta
+PREFIX datacite:
+PREFIX literal:
+PREFIX frbr:
+PREFIX fabio:
+SELECT DISTINCT ?cited_br WHERE {
+ [[doi]]
+}
+@@with index
+@@join ?cited_br ?cited_br
+@@values ?cited_br
+PREFIX cito:
+SELECT DISTINCT ?citing_br ?cited_br WHERE {
+ ?citation cito:hasCitedEntity ?cited_br ;
+ cito:hasCitingEntity ?citing_br .
}
LIMIT 200000
+@@with meta
+@@join ?citing_br ?citing_br
+@@values ?citing_br batch_size=10000 workers=8
+PREFIX datacite:
+PREFIX literal:
+SELECT ?citing_br (GROUP_CONCAT(DISTINCT ?id; SEPARATOR=" __ ") AS ?citing_ids) WHERE {
+ ?citing_br datacite:hasIdentifier ?identifier .
+ ?identifier datacite:usesIdentifierScheme ?scheme ;
+ literal:hasLiteralValue ?value .
+ BIND(CONCAT(STRAFTER(STR(?scheme), "http://purl.org/spar/datacite/"), ":", ?value) AS ?id)
+}
+GROUP BY ?citing_br
#url /reference-count/{doi}
#type operation
#doi str(10\..+)
-#preprocess lower(doi) --> id2omids(doi)
-#postprocess count_unique_cits(oci,citing,cited)
+#preprocess lower(doi) --> citing_search(doi)
+#postprocess count_groups(cited)
#method get
#description This operation retrieves the number of outgoing citations from the bibliographic entity identified by the input DOI.
@@ -118,22 +209,41 @@ The field returned by this operation is:
"count": "75"
}
]
-#sparql PREFIX cito:
-SELECT ?oci ?citing ?cited
-WHERE {
- VALUES ?citing {[[doi]]}
- ?oci cito:hasCitingEntity ?citing .
- ?oci cito:hasCitedEntity ?cited .
+#sparql @@with meta
+PREFIX datacite:
+PREFIX literal:
+PREFIX frbr:
+PREFIX fabio:
+SELECT DISTINCT ?citing_br WHERE {
+ [[doi]]
+}
+@@with index
+@@join ?citing_br ?citing_br
+@@values ?citing_br
+PREFIX cito:
+SELECT DISTINCT ?citing_br ?cited_br WHERE {
+ ?citation cito:hasCitingEntity ?citing_br ;
+ cito:hasCitedEntity ?cited_br .
}
LIMIT 200000
-
-
+@@with meta
+@@join ?cited_br ?cited_br
+@@values ?cited_br batch_size=10000 workers=8
+PREFIX datacite:
+PREFIX literal:
+SELECT ?cited_br (GROUP_CONCAT(DISTINCT ?id; SEPARATOR=" __ ") AS ?cited_ids) WHERE {
+ ?cited_br datacite:hasIdentifier ?identifier .
+ ?identifier datacite:usesIdentifierScheme ?scheme ;
+ literal:hasLiteralValue ?value .
+ BIND(CONCAT(STRAFTER(STR(?scheme), "http://purl.org/spar/datacite/"), ":", ?value) AS ?id)
+}
+GROUP BY ?cited_br
#url /citations/{doi}
#type operation
#doi str(10\..+)
-#preprocess lower(doi) --> id2omids(doi)
-#postprocess citations_info(oci,citing,cited)
+#preprocess lower(doi) --> cited_search(doi)
+#postprocess citations_info()
#method get
#description This operation retrieves the citation data for all the references appearing in the reference lists of other citing works to the bibliographic entity identified by the input DOI, that constitute the incoming citations of that identified bibliographic entity.
@@ -179,21 +289,100 @@ The values of all the fields are prefixed with `[index name] => `, so as to clea
},
...
]
-#field_type str(oci) str(citing) str(cited) datetime(creation) duration(timespan) str(?journal_sc) str(?author_sc)
-#sparql PREFIX cito:
-SELECT ?oci ?citing ?cited
-WHERE {
- VALUES ?cited {[[doi]]}
- ?oci cito:hasCitedEntity ?cited .
- ?oci cito:hasCitingEntity ?citing .
+#field_type str(oci) str(citing) str(cited) datetime(creation) duration(timespan) str(journal_sc) str(author_sc)
+#sparql @@with meta
+PREFIX datacite:
+PREFIX literal:
+PREFIX frbr:
+PREFIX fabio:
+SELECT DISTINCT ?cited_br WHERE {
+ [[doi]]
+}
+@@with index
+@@join ?cited_br ?cited_br
+@@values ?cited_br
+PREFIX cito:
+SELECT ?oci ?citing_br ?cited_br WHERE {
+ ?citation cito:hasCitedEntity ?cited_br ;
+ cito:hasCitingEntity ?citing_br .
+ BIND(STRAFTER(STR(?citation), "https://w3id.org/oc/index/ci/") AS ?oci)
}
LIMIT 200000
+@@with meta
+@@join ?citing_br ?citing_br
+@@values ?citing_br batch_size=10000 workers=8
+PREFIX datacite:
+PREFIX literal:
+PREFIX prism:
+SELECT ?citing_br (GROUP_CONCAT(DISTINCT ?id; SEPARATOR=" __ ") AS ?citing_ids) (MIN(STR(?date)) AS ?citing_date) WHERE {
+ ?citing_br datacite:hasIdentifier ?identifier .
+ ?identifier datacite:usesIdentifierScheme ?scheme ;
+ literal:hasLiteralValue ?value .
+ BIND(CONCAT(STRAFTER(STR(?scheme), "http://purl.org/spar/datacite/"), ":", ?value) AS ?id)
+ OPTIONAL { ?citing_br prism:publicationDate ?date }
+}
+GROUP BY ?citing_br
+@@with meta
+@@join ?cited_br ?cited_br
+@@values ?cited_br
+PREFIX datacite:
+PREFIX literal:
+PREFIX prism:
+SELECT ?cited_br (GROUP_CONCAT(DISTINCT ?id; SEPARATOR=" __ ") AS ?cited_ids) (MIN(STR(?date)) AS ?cited_date) WHERE {
+ ?cited_br datacite:hasIdentifier ?identifier .
+ ?identifier datacite:usesIdentifierScheme ?scheme ;
+ literal:hasLiteralValue ?value .
+ BIND(CONCAT(STRAFTER(STR(?scheme), "http://purl.org/spar/datacite/"), ":", ?value) AS ?id)
+ OPTIONAL { ?cited_br prism:publicationDate ?date }
+}
+GROUP BY ?cited_br
+@@join ?oci ?oci type=left
+@@values ?citing_br batch_size=10000 workers=8
+PREFIX datacite:
+PREFIX literal:
+PREFIX frbr:
+PREFIX fabio:
+PREFIX pro:
+SELECT DISTINCT ?oci ("yes" AS ?same_journal) WHERE {
+ {
+ SELECT ?cited_br ?journal WHERE {
+ [[doi]]
+ ?cited_br a fabio:JournalArticle ;
+ frbr:partOf+ ?journal .
+ ?journal a fabio:Journal .
+ }
+ }
+ ?citing_br a fabio:JournalArticle ;
+ frbr:partOf+ ?journal .
+ BIND(CONCAT(STRAFTER(STR(?citing_br), "https://w3id.org/oc/meta/br/"), "-", STRAFTER(STR(?cited_br), "https://w3id.org/oc/meta/br/")) AS ?oci)
+}
+@@join ?oci ?oci type=left
+@@values ?citing_br batch_size=10000 workers=8
+PREFIX datacite:
+PREFIX literal:
+PREFIX frbr:
+PREFIX fabio:
+PREFIX pro:
+SELECT DISTINCT ?oci ("yes" AS ?same_author) WHERE {
+ {
+ SELECT ?cited_br ?author WHERE {
+ [[doi]]
+ ?cited_br pro:isDocumentContextFor ?cited_role .
+ ?cited_role pro:withRole pro:author ;
+ pro:isHeldBy ?author .
+ }
+ }
+ ?citing_role pro:isHeldBy ?author ;
+ pro:withRole pro:author .
+ ?citing_br pro:isDocumentContextFor ?citing_role .
+ BIND(CONCAT(STRAFTER(STR(?citing_br), "https://w3id.org/oc/meta/br/"), "-", STRAFTER(STR(?cited_br), "https://w3id.org/oc/meta/br/")) AS ?oci)
+}
#url /references/{doi}
#type operation
#doi str(10\..+)
-#preprocess lower(doi) --> id2omids(doi)
-#postprocess citations_info(oci,citing,cited)
+#preprocess lower(doi) --> citing_search(doi)
+#postprocess citations_info()
#method get
#description This operation retrieves the citation data for all the outgoing references to other cited works appearing in the reference list of the bibliographic entity identified by the input DOI.
@@ -239,12 +428,91 @@ The values of all the fields are prefixed with `[index name] => `, so as to clea
},
...
]
-#field_type str(oci) str(citing) str(cited) datetime(creation) duration(timespan) str(?journal_sc) str(?author_sc)
-#sparql PREFIX cito:
-SELECT ?oci ?citing ?cited
-WHERE {
- VALUES ?citing {[[doi]]}
- ?oci cito:hasCitingEntity ?citing .
- ?oci cito:hasCitedEntity ?cited .
+#field_type str(oci) str(citing) str(cited) datetime(creation) duration(timespan) str(journal_sc) str(author_sc)
+#sparql @@with meta
+PREFIX datacite:
+PREFIX literal:
+PREFIX frbr:
+PREFIX fabio:
+SELECT DISTINCT ?citing_br WHERE {
+ [[doi]]
+}
+@@with index
+@@join ?citing_br ?citing_br
+@@values ?citing_br
+PREFIX cito:
+SELECT ?oci ?citing_br ?cited_br WHERE {
+ ?citation cito:hasCitingEntity ?citing_br ;
+ cito:hasCitedEntity ?cited_br .
+ BIND(STRAFTER(STR(?citation), "https://w3id.org/oc/index/ci/") AS ?oci)
}
LIMIT 200000
+@@with meta
+@@join ?citing_br ?citing_br
+@@values ?citing_br
+PREFIX datacite:
+PREFIX literal:
+PREFIX prism:
+SELECT ?citing_br (GROUP_CONCAT(DISTINCT ?id; SEPARATOR=" __ ") AS ?citing_ids) (MIN(STR(?date)) AS ?citing_date) WHERE {
+ ?citing_br datacite:hasIdentifier ?identifier .
+ ?identifier datacite:usesIdentifierScheme ?scheme ;
+ literal:hasLiteralValue ?value .
+ BIND(CONCAT(STRAFTER(STR(?scheme), "http://purl.org/spar/datacite/"), ":", ?value) AS ?id)
+ OPTIONAL { ?citing_br prism:publicationDate ?date }
+}
+GROUP BY ?citing_br
+@@with meta
+@@join ?cited_br ?cited_br
+@@values ?cited_br batch_size=10000 workers=8
+PREFIX datacite:
+PREFIX literal:
+PREFIX prism:
+SELECT ?cited_br (GROUP_CONCAT(DISTINCT ?id; SEPARATOR=" __ ") AS ?cited_ids) (MIN(STR(?date)) AS ?cited_date) WHERE {
+ ?cited_br datacite:hasIdentifier ?identifier .
+ ?identifier datacite:usesIdentifierScheme ?scheme ;
+ literal:hasLiteralValue ?value .
+ BIND(CONCAT(STRAFTER(STR(?scheme), "http://purl.org/spar/datacite/"), ":", ?value) AS ?id)
+ OPTIONAL { ?cited_br prism:publicationDate ?date }
+}
+GROUP BY ?cited_br
+@@join ?oci ?oci type=left
+@@values ?cited_br batch_size=10000 workers=8
+PREFIX datacite:
+PREFIX literal:
+PREFIX frbr:
+PREFIX fabio:
+PREFIX pro:
+SELECT DISTINCT ?oci ("yes" AS ?same_journal) WHERE {
+ {
+ SELECT ?citing_br ?journal WHERE {
+ [[doi]]
+ ?citing_br a fabio:JournalArticle ;
+ frbr:partOf+ ?journal .
+ ?journal a fabio:Journal .
+ }
+ }
+ ?cited_br a fabio:JournalArticle ;
+ frbr:partOf+ ?journal .
+ BIND(CONCAT(STRAFTER(STR(?citing_br), "https://w3id.org/oc/meta/br/"), "-", STRAFTER(STR(?cited_br), "https://w3id.org/oc/meta/br/")) AS ?oci)
+}
+@@join ?oci ?oci type=left
+@@values ?cited_br batch_size=10000 workers=8
+PREFIX datacite:
+PREFIX literal:
+PREFIX frbr:
+PREFIX fabio:
+PREFIX pro:
+SELECT DISTINCT ?oci ("yes" AS ?same_author) WHERE {
+ {
+ SELECT ?citing_br ?author WHERE {
+ [[doi]]
+ ?citing_br pro:isDocumentContextFor ?citing_role .
+ ?citing_role pro:withRole pro:author ;
+ pro:isHeldBy ?author .
+ }
+ }
+ ?cited_role pro:isHeldBy ?author ;
+ pro:withRole pro:author .
+ ?cited_br pro:isDocumentContextFor ?cited_role .
+ BIND(CONCAT(STRAFTER(STR(?citing_br), "https://w3id.org/oc/meta/br/"), "-", STRAFTER(STR(?cited_br), "https://w3id.org/oc/meta/br/")) AS ?oci)
+}
diff --git a/src/api/index_v2.hf b/src/api/index_v2.hf
index e1165c0..9d13006 100644
--- a/src/api/index_v2.hf
+++ b/src/api/index_v2.hf
@@ -2,7 +2,7 @@
#type api
#base https://api.opencitations.net
#title The REST API for OpenCitations Index
-#html_meta_description OpenCitations Index REST API: retrieve citation data, bibliographic references, citation counts using DOI, PMID, OMID identifiers. Free access.
+#html_meta_description OpenCitations Index REST API: retrieve citation data, bibliographic references, citation counts using DOI, PMID, ISSN, ISBN, or OMID identifiers. Free access.
#description This document describe the REST API for accessing the data stored in the [OpenCitations Index](https://w3id.org/oc/index) hosted by [OpenCitations](http://opencitations.net). This API implements operations to retrieve the citation data for all the references to other works appearing in a particular bibliographic entity, or the citation data for all the references appearing in other works to a particular bibliographic entity, given the identifier of a bibliographic entity, or to retrieve citation data about a particular citation identified by means of its [Open Citation Identifier (OCI)](https://opencitations.wordpress.com/2018/03/12/citations-as-first-class-data-entities-open-citation-identifiers/).
All the present operations return either a JSON document (default) or a CSV document according to the mimetype specified in the `Accept` header of the request. If you would like to suggest an additional operation to be included in this API, please use the [issue tracker](https://github.com/opencitations/api/issues) of the OpenCitations APIs available on GitHub.
@@ -24,13 +24,15 @@ get(API_CALL, headers=HTTP_HEADERS)
#contacts [contact@opencitations.net](mailto:contact@opencitations.net)
#license This document is licensed with a [Creative Commons Attribution 4.0 International License](https://creativecommons.org/licenses/by/4.0/legalcode), while the REST API itself has been created using [RAMOSE](https://github.com/opencitations/ramose), the *Restful API Manager Over SPARQL Endpoints* created by [Silvio Peroni](https://orcid.org/0000-0003-0530-4305), which is licensed with an [ISC license](https://opensource.org/licenses/ISC).
#endpoint http://qlever-service.default.svc.cluster.local:7011
+#sources meta=http://meta-qlever-service.default.svc.cluster.local:7011;index=http://qlever-service.default.svc.cluster.local:7011
#method post
#addon indexapi_v2
#url /citation/{oci}
#type operation
#oci str([0-9]+-[0-9]+)
-#postprocess citations_info(oci,citing,cited)
+#preprocess oci_search(oci)
+#postprocess citations_info()
#method get
#description This operation retrieves the citation metadata for the citation identified by the input Open Citation Identifier (OCI).
@@ -61,23 +63,91 @@ The values of all the fields are prefixed with `[index name] => `, so as to clea
"author_sc": "no"
}
]
-#field_type str(oci) str(citing) str(cited)
+#field_type str(oci) str(citing) str(cited) datetime(creation) duration(timespan) str(journal_sc) str(author_sc)
#sparql PREFIX cito:
-SELECT ?oci ?citing ?cited
-WHERE {
- VALUES ?oci {} .
- ?oci cito:hasCitingEntity ?citing .
- ?oci cito:hasCitedEntity ?cited .
+SELECT ?oci ?citing_br ?cited_br WHERE {
+ [[oci]]
+ ?citation cito:hasCitingEntity ?citing_br ;
+ cito:hasCitedEntity ?cited_br .
+ BIND(STRAFTER(STR(?citation), "https://w3id.org/oc/index/ci/") AS ?oci)
+}
+@@with meta
+@@join ?citing_br ?citing_br
+@@values ?citing_br batch_size=10000 workers=8
+PREFIX datacite:
+PREFIX literal:
+PREFIX prism:
+SELECT ?citing_br (GROUP_CONCAT(DISTINCT ?id; SEPARATOR=" __ ") AS ?citing_ids) (MIN(STR(?date)) AS ?citing_date) WHERE {
+ ?citing_br datacite:hasIdentifier ?identifier .
+ ?identifier datacite:usesIdentifierScheme ?scheme ;
+ literal:hasLiteralValue ?value .
+ BIND(CONCAT(STRAFTER(STR(?scheme), "http://purl.org/spar/datacite/"), ":", ?value) AS ?id)
+ OPTIONAL { ?citing_br prism:publicationDate ?date }
+}
+GROUP BY ?citing_br
+@@with meta
+@@join ?cited_br ?cited_br
+@@values ?cited_br
+PREFIX datacite:
+PREFIX literal:
+PREFIX prism:
+SELECT ?cited_br (GROUP_CONCAT(DISTINCT ?id; SEPARATOR=" __ ") AS ?cited_ids) (MIN(STR(?date)) AS ?cited_date) WHERE {
+ ?cited_br datacite:hasIdentifier ?identifier .
+ ?identifier datacite:usesIdentifierScheme ?scheme ;
+ literal:hasLiteralValue ?value .
+ BIND(CONCAT(STRAFTER(STR(?scheme), "http://purl.org/spar/datacite/"), ":", ?value) AS ?id)
+ OPTIONAL { ?cited_br prism:publicationDate ?date }
+}
+GROUP BY ?cited_br
+@@join ?oci ?oci type=left
+@@values ?citing_br batch_size=10000 workers=8
+PREFIX datacite:
+PREFIX literal:
+PREFIX frbr:
+PREFIX fabio:
+PREFIX pro:
+SELECT DISTINCT ?oci ("yes" AS ?same_journal) WHERE {
+ {
+ SELECT ?cited_br ?journal WHERE {
+ [[oci]]
+ ?cited_br a fabio:JournalArticle ;
+ frbr:partOf+ ?journal .
+ ?journal a fabio:Journal .
+ }
+ }
+ ?citing_br a fabio:JournalArticle ;
+ frbr:partOf+ ?journal .
+ BIND(CONCAT(STRAFTER(STR(?citing_br), "https://w3id.org/oc/meta/br/"), "-", STRAFTER(STR(?cited_br), "https://w3id.org/oc/meta/br/")) AS ?oci)
+}
+@@join ?oci ?oci type=left
+@@values ?citing_br batch_size=10000 workers=8
+PREFIX datacite:
+PREFIX literal:
+PREFIX frbr:
+PREFIX fabio:
+PREFIX pro:
+SELECT DISTINCT ?oci ("yes" AS ?same_author) WHERE {
+ {
+ SELECT ?cited_br ?author WHERE {
+ [[oci]]
+ ?cited_br pro:isDocumentContextFor ?cited_role .
+ ?cited_role pro:withRole pro:author ;
+ pro:isHeldBy ?author .
+ }
+ }
+ ?citing_role pro:isHeldBy ?author ;
+ pro:withRole pro:author .
+ ?citing_br pro:isDocumentContextFor ?citing_role .
+ BIND(CONCAT(STRAFTER(STR(?citing_br), "https://w3id.org/oc/meta/br/"), "-", STRAFTER(STR(?cited_br), "https://w3id.org/oc/meta/br/")) AS ?oci)
}
-LIMIT 50000
#url /citation-count/{id}
#type operation
-#id str((omid|doi|pmid):(.+))
-#preprocess lower(id) --> id2omids(id)
-#postprocess count_unique_cits(oci,citing,cited)
+#id str((omid|doi|pmid|issn|isbn):(.+))
+#preprocess lower(id) --> cited_search(id)
+#postprocess count_groups(citing)
#method get
-#description This operation retrieves the number of incoming citations to the bibliographic entity identified by the input PID (DOI, PMID, OMID)..
+#description This operation retrieves the number of incoming citations to the bibliographic entity identified by the input PID (DOI, PMID, ISSN, ISBN, OMID)..
The field returned by this operation is:
@@ -89,20 +159,41 @@ The field returned by this operation is:
"count": "34"
}
]
-#sparql PREFIX cito:
-SELECT ?oci ?citing ?cited
-WHERE {
- VALUES ?cited {[[id]]}
- ?oci cito:hasCitedEntity ?cited .
- ?oci cito:hasCitingEntity ?citing .
+#sparql @@with meta
+PREFIX datacite:
+PREFIX literal:
+PREFIX frbr:
+PREFIX fabio:
+SELECT DISTINCT ?cited_br WHERE {
+ [[id]]
+}
+@@with index
+@@join ?cited_br ?cited_br
+@@values ?cited_br
+PREFIX cito:
+SELECT DISTINCT ?citing_br ?cited_br WHERE {
+ ?citation cito:hasCitedEntity ?cited_br ;
+ cito:hasCitingEntity ?citing_br .
}
LIMIT 200000
+@@with meta
+@@join ?citing_br ?citing_br
+@@values ?citing_br batch_size=10000 workers=8
+PREFIX datacite:
+PREFIX literal:
+SELECT ?citing_br (GROUP_CONCAT(DISTINCT ?id; SEPARATOR=" __ ") AS ?citing_ids) WHERE {
+ ?citing_br datacite:hasIdentifier ?identifier .
+ ?identifier datacite:usesIdentifierScheme ?scheme ;
+ literal:hasLiteralValue ?value .
+ BIND(CONCAT(STRAFTER(STR(?scheme), "http://purl.org/spar/datacite/"), ":", ?value) AS ?id)
+}
+GROUP BY ?citing_br
#url /venue-citation-count/{id}
#type operation
#id str((issn):(.+))
-#preprocess lower(id) --> id2omids(id)
-#postprocess sum_all(count)
+#preprocess lower(id) --> issn_value(id)
+#postprocess venue_count()
#method get
#description This operation retrieves the number of incoming citations to all the bibliographic entities published into aspecific journal identified by the input ISSN.
@@ -116,21 +207,36 @@ The field returned by this operation is:
"count": "64352"
}
]
-#sparql PREFIX cito:
-SELECT (count(DISTINCT(?citing)) as ?count)
-WHERE {
- VALUES ?cited {[[id]]}
- ?oci cito:hasCitedEntity ?cited .
- ?oci cito:hasCitingEntity ?citing .
+#sparql @@with meta
+PREFIX datacite:
+PREFIX literal:
+PREFIX frbr:
+PREFIX fabio:
+SELECT DISTINCT ?issn ?cited_br WHERE {
+ VALUES ?issn { "[[id]]" }
+ ?venue_identifier literal:hasLiteralValue ?issn .
+ ?venue datacite:hasIdentifier ?venue_identifier .
+ ?cited_br frbr:partOf+ ?venue ;
+ a fabio:JournalArticle .
}
+@@with index
+@@join ?issn ?issn
+@@values ?cited_br
+PREFIX cito:
+SELECT ?issn (COUNT(DISTINCT ?citing_br) AS ?count) WHERE {
+ ?citation cito:hasCitedEntity ?cited_br ;
+ cito:hasCitingEntity ?citing_br .
+ BIND("[[id]]" AS ?issn)
+}
+GROUP BY ?issn
#url /reference-count/{id}
#type operation
-#id str((omid|doi|pmid|issn):(.+))
-#preprocess lower(id) --> id2omids(id)
-#postprocess count_unique_cits(oci,citing,cited)
+#id str((omid|doi|pmid|issn|isbn):(.+))
+#preprocess lower(id) --> citing_search(id)
+#postprocess count_unique_cits()
#method get
-#description This operation retrieves the number of outgoing citations from the bibliographic entity identified by the input PID (DOI, PMID, OMID).
+#description This operation retrieves the number of outgoing citations from the bibliographic entity identified by the input PID (DOI, PMID, ISSN, ISBN, OMID).
The field returned by this operation is:
@@ -142,22 +248,55 @@ The field returned by this operation is:
"count": "35"
}
]
-#sparql PREFIX cito:
-SELECT ?oci ?citing ?cited
-WHERE {
- VALUES ?citing {[[id]]}
- ?oci cito:hasCitingEntity ?citing .
- ?oci cito:hasCitedEntity ?cited .
+#sparql @@with meta
+PREFIX datacite:
+PREFIX literal:
+PREFIX frbr:
+PREFIX fabio:
+SELECT DISTINCT ?citing_br WHERE {
+ [[id]]
+}
+@@with index
+@@join ?citing_br ?citing_br
+@@values ?citing_br
+PREFIX cito:
+SELECT DISTINCT ?citing_br ?cited_br WHERE {
+ ?citation cito:hasCitingEntity ?citing_br ;
+ cito:hasCitedEntity ?cited_br .
}
LIMIT 200000
+@@with meta
+@@join ?citing_br ?citing_br
+@@values ?citing_br
+PREFIX datacite:
+PREFIX literal:
+SELECT ?citing_br (GROUP_CONCAT(DISTINCT ?id; SEPARATOR=" __ ") AS ?citing_ids) WHERE {
+ ?citing_br datacite:hasIdentifier ?identifier .
+ ?identifier datacite:usesIdentifierScheme ?scheme ;
+ literal:hasLiteralValue ?value .
+ BIND(CONCAT(STRAFTER(STR(?scheme), "http://purl.org/spar/datacite/"), ":", ?value) AS ?id)
+}
+GROUP BY ?citing_br
+@@with meta
+@@join ?cited_br ?cited_br
+@@values ?cited_br batch_size=10000 workers=8
+PREFIX datacite:
+PREFIX literal:
+SELECT ?cited_br (GROUP_CONCAT(DISTINCT ?id; SEPARATOR=" __ ") AS ?cited_ids) WHERE {
+ ?cited_br datacite:hasIdentifier ?identifier .
+ ?identifier datacite:usesIdentifierScheme ?scheme ;
+ literal:hasLiteralValue ?value .
+ BIND(CONCAT(STRAFTER(STR(?scheme), "http://purl.org/spar/datacite/"), ":", ?value) AS ?id)
+}
+GROUP BY ?cited_br
#url /citations/{id}
#type operation
-#id str((omid|doi|pmid):(.+))
-#preprocess lower(id) --> id2omids(id)
-#postprocess citations_info(oci,citing,cited)
+#id str((omid|doi|pmid|issn|isbn):(.+))
+#preprocess lower(id) --> cited_search(id)
+#postprocess citations_info()
#method get
-#description This operation retrieves the citation data for all the references appearing in the reference lists of other citing works to the bibliographic entity identified by the input PID (DOI, PMID, OMID), that constitute the incoming citations of that identified bibliographic entity.
+#description This operation retrieves the citation data for all the references appearing in the reference lists of other citing works to the bibliographic entity identified by the input PID (DOI, PMID, ISSN, ISBN, OMID), that constitute the incoming citations of that identified bibliographic entity.
The fields returned by this operation are:
@@ -201,23 +340,102 @@ The values of all the fields are prefixed with `[index name] => `, so as to clea
},
...
]
-#field_type str(oci) str(citing) str(cited) datetime(creation) duration(timespan) str(?journal_sc) str(?author_sc)
-#sparql PREFIX cito:
-SELECT ?oci ?citing ?cited
-WHERE {
- VALUES ?cited {[[id]]}
- ?oci cito:hasCitedEntity ?cited .
- ?oci cito:hasCitingEntity ?citing .
+#field_type str(oci) str(citing) str(cited) datetime(creation) duration(timespan) str(journal_sc) str(author_sc)
+#sparql @@with meta
+PREFIX datacite:
+PREFIX literal:
+PREFIX frbr:
+PREFIX fabio:
+SELECT DISTINCT ?cited_br WHERE {
+ [[id]]
+}
+@@with index
+@@join ?cited_br ?cited_br
+@@values ?cited_br
+PREFIX cito:
+SELECT ?oci ?citing_br ?cited_br WHERE {
+ ?citation cito:hasCitedEntity ?cited_br ;
+ cito:hasCitingEntity ?citing_br .
+ BIND(STRAFTER(STR(?citation), "https://w3id.org/oc/index/ci/") AS ?oci)
}
LIMIT 200000
+@@with meta
+@@join ?citing_br ?citing_br
+@@values ?citing_br batch_size=10000 workers=8
+PREFIX datacite:
+PREFIX literal:
+PREFIX prism:
+SELECT ?citing_br (GROUP_CONCAT(DISTINCT ?id; SEPARATOR=" __ ") AS ?citing_ids) (MIN(STR(?date)) AS ?citing_date) WHERE {
+ ?citing_br datacite:hasIdentifier ?identifier .
+ ?identifier datacite:usesIdentifierScheme ?scheme ;
+ literal:hasLiteralValue ?value .
+ BIND(CONCAT(STRAFTER(STR(?scheme), "http://purl.org/spar/datacite/"), ":", ?value) AS ?id)
+ OPTIONAL { ?citing_br prism:publicationDate ?date }
+}
+GROUP BY ?citing_br
+@@with meta
+@@join ?cited_br ?cited_br
+@@values ?cited_br
+PREFIX datacite:
+PREFIX literal:
+PREFIX prism:
+SELECT ?cited_br (GROUP_CONCAT(DISTINCT ?id; SEPARATOR=" __ ") AS ?cited_ids) (MIN(STR(?date)) AS ?cited_date) WHERE {
+ ?cited_br datacite:hasIdentifier ?identifier .
+ ?identifier datacite:usesIdentifierScheme ?scheme ;
+ literal:hasLiteralValue ?value .
+ BIND(CONCAT(STRAFTER(STR(?scheme), "http://purl.org/spar/datacite/"), ":", ?value) AS ?id)
+ OPTIONAL { ?cited_br prism:publicationDate ?date }
+}
+GROUP BY ?cited_br
+@@join ?oci ?oci type=left
+@@values ?citing_br batch_size=10000 workers=8
+PREFIX datacite:
+PREFIX literal:
+PREFIX frbr:
+PREFIX fabio:
+PREFIX pro:
+SELECT DISTINCT ?oci ("yes" AS ?same_journal) WHERE {
+ {
+ SELECT ?cited_br ?journal WHERE {
+ [[id]]
+ ?cited_br a fabio:JournalArticle ;
+ frbr:partOf+ ?journal .
+ ?journal a fabio:Journal .
+ }
+ }
+ ?citing_br a fabio:JournalArticle ;
+ frbr:partOf+ ?journal .
+ BIND(CONCAT(STRAFTER(STR(?citing_br), "https://w3id.org/oc/meta/br/"), "-", STRAFTER(STR(?cited_br), "https://w3id.org/oc/meta/br/")) AS ?oci)
+}
+@@join ?oci ?oci type=left
+@@values ?citing_br batch_size=10000 workers=8
+PREFIX datacite:
+PREFIX literal:
+PREFIX frbr:
+PREFIX fabio:
+PREFIX pro:
+SELECT DISTINCT ?oci ("yes" AS ?same_author) WHERE {
+ {
+ SELECT ?cited_br ?author WHERE {
+ [[id]]
+ ?cited_br pro:isDocumentContextFor ?cited_role .
+ ?cited_role pro:withRole pro:author ;
+ pro:isHeldBy ?author .
+ }
+ }
+ ?citing_role pro:isHeldBy ?author ;
+ pro:withRole pro:author .
+ ?citing_br pro:isDocumentContextFor ?citing_role .
+ BIND(CONCAT(STRAFTER(STR(?citing_br), "https://w3id.org/oc/meta/br/"), "-", STRAFTER(STR(?cited_br), "https://w3id.org/oc/meta/br/")) AS ?oci)
+}
#url /references/{id}
#type operation
-#id str((omid|doi|pmid):(.+))
-#preprocess lower(id) --> id2omids(id)
-#postprocess citations_info(oci,citing,cited)
+#id str((omid|doi|pmid|issn|isbn):(.+))
+#preprocess lower(id) --> citing_search(id)
+#postprocess citations_info()
#method get
-#description This operation retrieves the citation data for all the outgoing references to other cited works appearing in the reference list of the bibliographic entity identified by the input PID (DOI, PMID, OMID)..
+#description This operation retrieves the citation data for all the outgoing references to other cited works appearing in the reference list of the bibliographic entity identified by the input PID (DOI, PMID, ISSN, ISBN, OMID)..
The fields returned by this operation are:
@@ -232,7 +450,6 @@ The fields returned by this operation are:
The values of all the fields are prefixed with `[index name] => `, so as to cleary identify from where the related data is coming, and can contain one or more information, separated by `; `. This is particularly useful when a citation is actually contained in two or more OpenCitations Indexes. In this case, only one row will be returned, and the prefix used in the various data allows one to understand the source Index of such data.
#call /references/doi:10.7717/peerj-cs.421
#output_json [
-[
{
"oci": "06101801781-06101802023",
"citing": "omid:br/06101801781 doi:10.7717/peerj-cs.421 pmid:33817056",
@@ -262,12 +479,91 @@ The values of all the fields are prefixed with `[index name] => `, so as to clea
},
...
]
-#field_type str(oci) str(citing) str(cited) datetime(creation) duration(timespan) str(?journal_sc) str(?author_sc)
-#sparql PREFIX cito:
-SELECT ?oci ?citing ?cited
-WHERE {
- VALUES ?citing {[[id]]}
- ?oci cito:hasCitingEntity ?citing .
- ?oci cito:hasCitedEntity ?cited .
+#field_type str(oci) str(citing) str(cited) datetime(creation) duration(timespan) str(journal_sc) str(author_sc)
+#sparql @@with meta
+PREFIX datacite:
+PREFIX literal:
+PREFIX frbr:
+PREFIX fabio:
+SELECT DISTINCT ?citing_br WHERE {
+ [[id]]
+}
+@@with index
+@@join ?citing_br ?citing_br
+@@values ?citing_br
+PREFIX cito:
+SELECT ?oci ?citing_br ?cited_br WHERE {
+ ?citation cito:hasCitingEntity ?citing_br ;
+ cito:hasCitedEntity ?cited_br .
+ BIND(STRAFTER(STR(?citation), "https://w3id.org/oc/index/ci/") AS ?oci)
}
LIMIT 200000
+@@with meta
+@@join ?citing_br ?citing_br
+@@values ?citing_br
+PREFIX datacite:
+PREFIX literal:
+PREFIX prism:
+SELECT ?citing_br (GROUP_CONCAT(DISTINCT ?id; SEPARATOR=" __ ") AS ?citing_ids) (MIN(STR(?date)) AS ?citing_date) WHERE {
+ ?citing_br datacite:hasIdentifier ?identifier .
+ ?identifier datacite:usesIdentifierScheme ?scheme ;
+ literal:hasLiteralValue ?value .
+ BIND(CONCAT(STRAFTER(STR(?scheme), "http://purl.org/spar/datacite/"), ":", ?value) AS ?id)
+ OPTIONAL { ?citing_br prism:publicationDate ?date }
+}
+GROUP BY ?citing_br
+@@with meta
+@@join ?cited_br ?cited_br
+@@values ?cited_br batch_size=10000 workers=8
+PREFIX datacite:
+PREFIX literal:
+PREFIX prism:
+SELECT ?cited_br (GROUP_CONCAT(DISTINCT ?id; SEPARATOR=" __ ") AS ?cited_ids) (MIN(STR(?date)) AS ?cited_date) WHERE {
+ ?cited_br datacite:hasIdentifier ?identifier .
+ ?identifier datacite:usesIdentifierScheme ?scheme ;
+ literal:hasLiteralValue ?value .
+ BIND(CONCAT(STRAFTER(STR(?scheme), "http://purl.org/spar/datacite/"), ":", ?value) AS ?id)
+ OPTIONAL { ?cited_br prism:publicationDate ?date }
+}
+GROUP BY ?cited_br
+@@join ?oci ?oci type=left
+@@values ?cited_br batch_size=10000 workers=8
+PREFIX datacite:
+PREFIX literal:
+PREFIX frbr:
+PREFIX fabio:
+PREFIX pro:
+SELECT DISTINCT ?oci ("yes" AS ?same_journal) WHERE {
+ {
+ SELECT ?citing_br ?journal WHERE {
+ [[id]]
+ ?citing_br a fabio:JournalArticle ;
+ frbr:partOf+ ?journal .
+ ?journal a fabio:Journal .
+ }
+ }
+ ?cited_br a fabio:JournalArticle ;
+ frbr:partOf+ ?journal .
+ BIND(CONCAT(STRAFTER(STR(?citing_br), "https://w3id.org/oc/meta/br/"), "-", STRAFTER(STR(?cited_br), "https://w3id.org/oc/meta/br/")) AS ?oci)
+}
+@@join ?oci ?oci type=left
+@@values ?cited_br batch_size=10000 workers=8
+PREFIX datacite:
+PREFIX literal:
+PREFIX frbr:
+PREFIX fabio:
+PREFIX pro:
+SELECT DISTINCT ?oci ("yes" AS ?same_author) WHERE {
+ {
+ SELECT ?citing_br ?author WHERE {
+ [[id]]
+ ?citing_br pro:isDocumentContextFor ?citing_role .
+ ?citing_role pro:withRole pro:author ;
+ pro:isHeldBy ?author .
+ }
+ }
+ ?cited_role pro:isHeldBy ?author ;
+ pro:withRole pro:author .
+ ?cited_br pro:isDocumentContextFor ?cited_role .
+ BIND(CONCAT(STRAFTER(STR(?citing_br), "https://w3id.org/oc/meta/br/"), "-", STRAFTER(STR(?cited_br), "https://w3id.org/oc/meta/br/")) AS ?oci)
+}
diff --git a/src/api/indexapi_common.py b/src/api/indexapi_common.py
index 2427ed3..3d288ea 100644
--- a/src/api/indexapi_common.py
+++ b/src/api/indexapi_common.py
@@ -1,187 +1,66 @@
-import json
-import os
-from requests import RequestException, post
-from json import loads
from datetime import datetime
from dateutil.relativedelta import relativedelta
-with open("conf.json") as f:
- c = json.load(f)
-
-env_config = {
- "base_url": os.getenv("BASE_URL", c["base_url"]),
- "sparql_endpoint_index": os.getenv(
- "SPARQL_ENDPOINT_INDEX", c["sparql_endpoint_index"]
- ),
- "sparql_endpoint_meta": os.getenv(
- "SPARQL_ENDPOINT_META", c["sparql_endpoint_meta"]
- ),
- "sync_enabled": os.getenv("SYNC_ENABLED", "false").lower() == "true",
-}
-
def lower(s):
return (s.lower(),)
-def br_meta_metadata(values):
- sparql_endpoint = env_config["sparql_endpoint_meta"]
-
- sparql_query = (
- """
- PREFIX pro:
- PREFIX frbr:
- PREFIX fabio:
- PREFIX datacite:
- PREFIX literal:
- PREFIX prism:
- SELECT DISTINCT ?val ?pubDate (GROUP_CONCAT(DISTINCT ?id; SEPARATOR=' __ ') AS ?ids) (GROUP_CONCAT(?venue; separator="; ") as ?source) (GROUP_CONCAT(?raAuthor; separator="; ") as ?author)
- WHERE {
- VALUES ?val { """
- + " ".join(values)
- + """ }
- OPTIONAL { ?val prism:publicationDate ?pubDate. }
- OPTIONAL {
- ?val datacite:hasIdentifier ?identifier.
- ?identifier datacite:usesIdentifierScheme ?scheme;
- literal:hasLiteralValue ?literalValue.
- BIND(CONCAT(STRAFTER(STR(?scheme), "http://purl.org/spar/datacite/"), ":", ?literalValue) AS ?id)
- }
- OPTIONAL {
- ?val a fabio:JournalArticle;
- frbr:partOf+ ?venue.
- ?venue a fabio:Journal.
- }
- OPTIONAL {
- ?val frbr:partOf ?venue.
- }
- OPTIONAL {
- ?val pro:isDocumentContextFor ?arAuthor.
- ?arAuthor pro:withRole pro:author;
- pro:isHeldBy ?raAuthor.
- }
- } GROUP BY ?val ?pubDate
- """
+def oci_search(oci):
+ citing, cited = oci.split("-")
+ return (
+ f"VALUES ?citation {{ }} "
+ f"VALUES ?citing_br {{ }} "
+ f"VALUES ?cited_br {{ }}",
)
- headers = {
- "Accept": "application/sparql-results+json",
- "Content-Type": "application/sparql-query",
- }
-
- try:
- response = post(sparql_endpoint, headers=headers, data=sparql_query)
- response.raise_for_status()
- except RequestException:
- return {}, []
- r = loads(response.text)
- results = r["results"]["bindings"]
- res_json = {elem["val"]["value"]: elem for elem in results}
- return res_json, ["val", "pubDate", "ids", "source", "author"]
-
-
-def br_meta_anyids(values):
- sparql_endpoint = env_config["sparql_endpoint_meta"]
-
- sparql_query = (
- """
- PREFIX datacite:
- PREFIX literal:
- SELECT DISTINCT ?val (GROUP_CONCAT(DISTINCT ?id; SEPARATOR=' __ ') AS ?ids)
- WHERE {
- VALUES ?val { """
- + " ".join(values)
- + """ }
- OPTIONAL {
- ?val datacite:hasIdentifier ?identifier.
- ?identifier datacite:usesIdentifierScheme ?scheme;
- literal:hasLiteralValue ?literalValue.
- BIND(CONCAT(STRAFTER(STR(?scheme), "http://purl.org/spar/datacite/"), ":", ?literalValue) AS ?id)
- }
- } GROUP BY ?val
- """
- )
-
- headers = {
- "Accept": "application/sparql-results+json",
- "Content-Type": "application/sparql-query",
- }
-
- try:
- response = post(sparql_endpoint, headers=headers, data=sparql_query)
- response.raise_for_status()
- except RequestException:
- return {}, []
- r = loads(response.text)
- results = r["results"]["bindings"]
- res_json = {elem["val"]["value"]: elem for elem in results}
- return res_json, ["val", "ids"]
+def literal_search(value, variable):
+ return (
+ f'?resolved_identifier literal:hasLiteralValue "{value}" . '
+ f"?{variable} datacite:hasIdentifier ?resolved_identifier ."
+ )
-def get_unique_brs_metadata(l_url_brs, ids_only=False):
- res: list[list[str]] = []
- l_brs = ["<" + _url_br + ">" for _url_br in l_url_brs]
-
- fetch = br_meta_anyids if ids_only else br_meta_metadata
- i = 0
- chunk_size = 3000
- brs_meta: dict[str, dict[str, dict[str, str]]] = {}
- while i < len(l_brs):
- chunk = l_brs[i : i + chunk_size]
- m_br = fetch(chunk)
- brs_meta.update(m_br[0])
- if i == 0:
- res.append(m_br[1])
- i += chunk_size
-
- unique_brs_anyid: list[set[str]] = []
- for k_val in brs_meta.values():
- br_ids = k_val["ids"]["value"]
- if br_ids:
- s = set(br_ids.split(" __ "))
- _c_intersection = 0
- for __unique in unique_brs_anyid:
- _c_intersection += len(__unique.intersection(s))
- if _c_intersection == 0:
- unique_brs_anyid.append(s)
- br_values = [k_val[k]["value"] if k in k_val else "" for k in res[0]]
- res.append(br_values)
-
- f_res = {}
- for row in res[1:]:
- f_res[row[0]] = {k_val: row[i] for i, k_val in enumerate(res[0])}
- return f_res
+def unique_citations(res):
+ citing_groups: dict[str, str] = {}
+ cited_groups: dict[str, str] = {}
+ citations: dict[tuple[str, str], dict[str, str]] = {}
+ for row in sorted(__rows(res), key=lambda row: (row["citing_br"], row["cited_br"])):
+ key = (
+ __group(row["citing_br"], row["citing_ids"], citing_groups),
+ __group(row["cited_br"], row["cited_ids"], cited_groups),
+ )
+ citations.setdefault(key, row)
+ return list(citations.values())
-def get_pub_date(elem):
- return elem["pubDate"]
+def count_unique_cits(res):
+ return [["count"], [len(unique_citations(res))]], True
-def get_source(elem):
- return elem["source"].split("; ")
+def count_groups(res, side):
+ entities = sorted({(row[f"{side}_br"], row[f"{side}_ids"]) for row in __rows(res)})
+ groups: dict[str, str] = {}
+ return [["count"], [len({__group(*entity, groups) for entity in entities})]], True
-def get_author(elem):
- return elem["author"].split("; ")
+def citation_row(citation, citing, cited):
+ return [
+ citation["oci"],
+ citing,
+ cited,
+ citation["citing_date"],
+ cit_duration(citation["citing_date"], citation["cited_date"]),
+ __yes_no(citation, "same_journal"),
+ __yes_no(citation, "same_author"),
+ ]
def get_id_val(val):
return val.replace("https://w3id.org/oc/meta/br/", "")
-def cit_journal_sc(citing_source_ids, cited_source_ids):
- if len(set(citing_source_ids).intersection(set(cited_source_ids))) > 0:
- return "yes"
- return "no"
-
-
-def cit_author_sc(citing_authors, cited_authors):
- if len(set(citing_authors).intersection(set(cited_authors))) > 0:
- return "yes"
- return "no"
-
-
def cit_duration(citing_complete_pub_date, cited_complete_pub_date):
def _contains_years(date):
@@ -230,3 +109,25 @@ def _contains_days(date):
result += "%sD" % abs(delta.days)
return result
+
+
+def __rows(res):
+ header = res[0]
+ return [
+ {field: value for field, (_, value) in zip(header, typed_row)}
+ for typed_row in res[1:]
+ ]
+
+
+def __group(br, ids, groups):
+ identifiers = ids.split(" __ ")
+ for identifier in identifiers:
+ if identifier in groups:
+ return groups[identifier]
+ for identifier in identifiers:
+ groups[identifier] = br
+ return br
+
+
+def __yes_no(citation, column):
+ return "yes" if citation.get(column) == "yes" else "no"
diff --git a/src/api/indexapi_v1.py b/src/api/indexapi_v1.py
index b421392..b137003 100644
--- a/src/api/indexapi_v1.py
+++ b/src/api/indexapi_v1.py
@@ -16,151 +16,41 @@
__author__ = "Arcangelo Massari & Ivan Heibi"
-from requests import RequestException, post
-from json import loads
from indexapi_common import (
lower, # noqa: F401 - used by ramose via getattr
- env_config,
- get_unique_brs_metadata,
- get_pub_date,
- get_source,
- get_author,
- get_id_val,
- cit_journal_sc,
- cit_author_sc,
- cit_duration,
+ count_unique_cits, # noqa: F401 - used by ramose via getattr
+ count_groups, # noqa: F401 - used by ramose via getattr
+ oci_search, # noqa: F401 - used by ramose via getattr
+ literal_search,
+ unique_citations,
+ citation_row,
)
-def id2omids(s):
- MULTI_VAL_MAX = 9000
- sparql_endpoint = env_config["sparql_endpoint_meta"]
-
- sparql_query = (
- """
- PREFIX datacite:
- PREFIX literal:
- SELECT ?br {
- { ?identifier literal:hasLiteralValue '"""
- + s
- + """'^^. }
- UNION
- { ?identifier literal:hasLiteralValue '"""
- + s
- + """'. }
- ?br datacite:hasIdentifier ?identifier
- }
- """
- )
-
- headers = {
- "Accept": "application/sparql-results+json",
- "Content-Type": "application/sparql-query",
- }
- try:
- response = post(sparql_endpoint, headers=headers, data=sparql_query, timeout=45)
- response.raise_for_status()
- except RequestException:
- return ("",)
- r = loads(response.text)
- results = r["results"]["bindings"]
- omid_l = [elem["br"]["value"].split("meta/br/")[1] for elem in results]
-
- if len(omid_l) == 0:
- return ("",)
-
- sparql_values = []
- for i in range(0, len(omid_l), MULTI_VAL_MAX):
- sparql_values.append(
- " ".join(
- [
- ""
- for e in omid_l[i : i + MULTI_VAL_MAX]
- ]
- )
- )
- return (sparql_values,)
-
-
-def count_unique_cits(res, *args):
- header = res[0]
- citing_idx = header.index(args[1])
- cited_idx = header.index(args[2])
- set_oci = set()
-
- # build
- if len(res) > 1:
- citing_to_dedup = []
- cited_to_dedup = []
- for row in res[1:]:
- citing_to_dedup.extend(row[citing_idx])
- cited_to_dedup.extend(row[cited_idx])
-
- citing_to_dedup_meta = get_unique_brs_metadata(
- list(set(citing_to_dedup)), ids_only=True
- )
- cited_to_dedup_meta = get_unique_brs_metadata(
- list(set(cited_to_dedup)), ids_only=True
- )
- for _k_citing in citing_to_dedup_meta.keys():
- for _k_cited in cited_to_dedup_meta.keys():
- set_oci.add((_k_citing, _k_cited))
- return [["count"], [len(set_oci)]], True
+def cited_search(doi):
+ return (literal_search(doi, "cited_br"),)
-# args must contain the and
-def citations_info(res, *args):
+def citing_search(doi):
+ return (literal_search(doi, "citing_br"),)
- header = res[0]
- citing_idx = header.index(args[1])
- cited_idx = header.index(args[2])
- # build
+def citations_info(res):
f_res = [
["oci", "citing", "cited", "creation", "timespan", "journal_sc", "author_sc"]
]
-
- if len(res) > 1:
- citing_to_dedup = []
- cited_to_dedup = []
- for row in res[1:]:
- citing_to_dedup.extend(row[citing_idx])
- cited_to_dedup.extend(row[cited_idx])
-
- citing_to_dedup_meta = get_unique_brs_metadata(list(set(citing_to_dedup)))
- cited_to_dedup_meta = get_unique_brs_metadata(list(set(cited_to_dedup)))
-
- for citing_entity in citing_to_dedup_meta:
- for cited_entity in cited_to_dedup_meta:
- _citing = citing_to_dedup_meta[citing_entity]
- _cited = cited_to_dedup_meta[cited_entity]
-
- res_row = [
- # oci value
- get_id_val(citing_entity) + "-" + get_id_val(cited_entity),
- # citing
- __get_doi(_citing),
- # cited
- __get_doi(_cited),
- # creation = citing[pub_date]
- get_pub_date(_citing),
- # timespan = citing[pub_date] - cited[pub_date]
- cit_duration(get_pub_date(_citing), get_pub_date(_cited)),
- # journal_sc = compare citing[source_id] and cited[source_id]
- cit_journal_sc(get_source(_citing), get_source(_cited)),
- # author_sc = compare citing[source_id] and cited[source_id]
- cit_author_sc(get_author(_citing), get_author(_cited)),
- ]
- f_res.append(res_row)
-
+ for citation in unique_citations(res):
+ f_res.append(
+ citation_row(
+ citation,
+ __get_doi(citation["citing_ids"]),
+ __get_doi(citation["cited_ids"]),
+ )
+ )
return f_res, True
-def __get_doi(elem):
- str_ids = []
- if "ids" in elem:
- for id in elem["ids"].split(" __ "):
- if id.startswith("doi:"):
- str_ids.append(id.split("doi:")[1])
-
- return " ".join(str_ids)
+def __get_doi(ids):
+ return " ".join(
+ id.removeprefix("doi:") for id in ids.split(" __ ") if id.startswith("doi:")
+ )
diff --git a/src/api/indexapi_v2.py b/src/api/indexapi_v2.py
index a9c8bc6..04ac76a 100644
--- a/src/api/indexapi_v2.py
+++ b/src/api/indexapi_v2.py
@@ -16,224 +16,74 @@
__author__ = "Arcangelo Massari & Ivan Heibi"
-from requests import RequestException, post
-from json import loads
+import re
+
from indexapi_common import (
lower, # noqa: F401 - used by ramose via getattr
- env_config,
- get_unique_brs_metadata,
- get_pub_date,
- get_source,
- get_author,
+ count_unique_cits, # noqa: F401 - used by ramose via getattr
+ count_groups, # noqa: F401 - used by ramose via getattr
+ oci_search, # noqa: F401 - used by ramose via getattr
+ literal_search,
+ unique_citations,
+ citation_row,
get_id_val,
- cit_journal_sc,
- cit_author_sc,
- cit_duration,
)
-def id2omids(s):
- if "omid" in s:
- return (s.replace("omid:br/", "",)
- return (__get_omid_of(s),)
+def cited_search(s):
+ return (__br_search(s, "cited_br"),)
-def count_unique_cits(res, *args):
- header = res[0]
- citing_idx = header.index(args[1])
- cited_idx = header.index(args[2])
- set_oci = set()
-
- # build
- if len(res) > 1:
- citing_to_dedup = []
- cited_to_dedup = []
- for row in res[1:]:
- citing_to_dedup.extend(row[citing_idx])
- cited_to_dedup.extend(row[cited_idx])
-
- citing_to_dedup_meta = get_unique_brs_metadata(
- list(set(citing_to_dedup)), ids_only=True
- )
- cited_to_dedup_meta = get_unique_brs_metadata(
- list(set(cited_to_dedup)), ids_only=True
- )
- for _k_citing in citing_to_dedup_meta.keys():
- for _k_cited in cited_to_dedup_meta.keys():
- set_oci.add((_k_citing, _k_cited))
+def citing_search(s):
+ return (__br_search(s, "citing_br"),)
- return [["count"], [len(set_oci)]], True
+def issn_value(s):
+ value = re.sub("[^X0-9]", "", s.removeprefix("issn:").upper())
+ return (f"{value[:4]}-{value[4:8]}",)
-# args must contain the and
-def citations_info(res, *args):
- header = res[0]
- citing_idx = header.index(args[1])
- cited_idx = header.index(args[2])
+def isbn_value(s):
+ value = re.sub("[^X0-9]", "", s.removeprefix("isbn:").upper())
+ return (value,)
+
- # build
+def citations_info(res):
f_res = [
["oci", "citing", "cited", "creation", "timespan", "journal_sc", "author_sc"]
]
-
- if len(res) > 1:
- citing_to_dedup = []
- cited_to_dedup = []
- for row in res[1:]:
- citing_to_dedup.extend(row[citing_idx])
- cited_to_dedup.extend(row[cited_idx])
-
- citing_to_dedup_meta = get_unique_brs_metadata(list(set(citing_to_dedup)))
- cited_to_dedup_meta = get_unique_brs_metadata(list(set(cited_to_dedup)))
-
- for citing_entity in citing_to_dedup_meta:
- for cited_entity in cited_to_dedup_meta:
- _citing = citing_to_dedup_meta[citing_entity]
- _cited = cited_to_dedup_meta[cited_entity]
-
- res_row = [
- # oci value
- get_id_val(citing_entity) + "-" + get_id_val(cited_entity),
- # citing
- __get_all_pids(_citing, citing_entity),
- # cited
- __get_all_pids(_cited, cited_entity),
- # creation = citing[pub_date]
- get_pub_date(_citing),
- # timespan = citing[pub_date] - cited[pub_date]
- cit_duration(get_pub_date(_citing), get_pub_date(_cited)),
- # journal_sc = compare citing[source_id] and cited[source_id]
- cit_journal_sc(get_source(_citing), get_source(_cited)),
- # author_sc = compare citing[source_id] and cited[source_id]
- cit_author_sc(get_author(_citing), get_author(_cited)),
- ]
- f_res.append(res_row)
-
+ for citation in unique_citations(res):
+ f_res.append(
+ citation_row(
+ citation,
+ __get_all_pids(citation["citing_br"], citation["citing_ids"]),
+ __get_all_pids(citation["cited_br"], citation["cited_ids"]),
+ )
+ )
return f_res, True
-# args must contain the
-def sum_all(res, *args):
-
+def venue_count(res):
header = res[0]
- count_idx = header.index(args[0])
-
- tot_count = 0
- for row in res[1:]:
- tot_count += int(row[count_idx][1])
-
- res = [header, [str(tot_count)]]
- return res, True
-
-
-# ---
-# Local methods
-# ---
-
-
-def __get_omid_of(s):
- MULTI_VAL_MAX = 9000
- sparql_endpoint = env_config["sparql_endpoint_meta"]
-
- # SPARQL query
- is_journal = False
- br_pre_l = [
- "doi",
- "issn",
- "isbn",
- "pmid",
- "pmcid",
- "url",
- "wikidata",
- "wikipedia",
- "jid",
- "arxiv",
- ]
- for br_pre in br_pre_l:
- if s.startswith(br_pre + ":"):
- s = s.replace(br_pre + ":", "")
- # check if is journal
- is_journal = br_pre in ["issn"]
- break
-
- sparql_query = (
- """
- PREFIX datacite:
- PREFIX literal:
- SELECT ?br {
- { ?identifier literal:hasLiteralValue '"""
- + s
- + """'^^. }
- UNION
- {?identifier literal:hasLiteralValue '"""
- + s
- + """'.}
- ?br datacite:hasIdentifier ?identifier
- }
- """
- )
-
- # in case is a journal the SAPRQL query retrieves all associated BRs
- if is_journal:
- sparql_query = (
- """
- PREFIX datacite:
- PREFIX literal:
- PREFIX ns1:
- PREFIX fabio:
- SELECT ?br {
- { ?identifier literal:hasLiteralValue '"""
- + s
- + """'^^. }
- UNION
- {?identifier literal:hasLiteralValue '"""
- + s
- + """'.}
- ?venue datacite:hasIdentifier ?identifier .
- {?br ns1:partOf ?venue .}
- UNION { ?br ns1:partOf/ns1:partOf ?venue . }
- UNION { ?br ns1:partOf/ns1:partOf/ns1:partOf ?venue . }
- UNION { ?br ns1:partOf/ns1:partOf/ns1:partOf/ns1:partOf ?venue .}
- ?br a fabio:JournalArticle .
- }
- """
+ count = res[1][header.index("count")][1] if len(res) > 1 else "0"
+ return [["count"], [count]], True
+
+
+def __br_search(s, variable):
+ scheme, value = s.split(":", 1)
+ if scheme == "omid":
+ return f"VALUES ?{variable} {{ }}"
+ if scheme == "issn":
+ value = issn_value(s)[0]
+ elif scheme == "isbn":
+ value = isbn_value(s)[0]
+ if scheme in {"issn", "isbn"}:
+ return (
+ literal_search(value, variable)
+ + f" ?resolved_identifier datacite:usesIdentifierScheme datacite:{scheme} ."
)
+ return literal_search(value, variable)
- headers = {
- "Accept": "application/sparql-results+json",
- "Content-Type": "application/sparql-query",
- }
- try:
- response = post(sparql_endpoint, headers=headers, data=sparql_query, timeout=45)
- response.raise_for_status()
- except RequestException:
- return ""
- r = loads(response.text)
- results = r["results"]["bindings"]
- omid_l = [elem["br"]["value"].split("meta/br/")[1] for elem in results]
-
- if len(omid_l) == 0:
- return ""
-
- sparql_values = []
- for i in range(0, len(omid_l), MULTI_VAL_MAX):
- sparql_values.append(
- " ".join(
- [
- ""
- for e in omid_l[i : i + MULTI_VAL_MAX]
- ]
- )
- )
- return sparql_values
-
-
-def __get_all_pids(elem, uri_omid):
- str_omid = "omid:br/" + get_id_val(uri_omid)
- str_ids = [str_omid]
- if "ids" in elem:
- for id in elem["ids"].split(" __ "):
- str_ids.append(id)
- return " ".join(str_ids)
+def __get_all_pids(br, ids):
+ return " ".join(["omid:br/" + get_id_val(br), *ids.split(" __ ")])
diff --git a/src/api/meta_v1.hf b/src/api/meta_v1.hf
index 740b90f..a3028e3 100644
--- a/src/api/meta_v1.hf
+++ b/src/api/meta_v1.hf
@@ -21,7 +21,7 @@ get(API_CALL, headers=HTTP_HEADERS)
#version Version 1.1.1 (2022-12-22)
#contacts [contact@opencitations.net](mailto:contact@opencitations.net)
#license This document is licensed with a [Creative Commons Attribution 4.0 International License](https://creativecommons.org/licenses/by/4.0/legalcode), while the REST API itself has been created using [RAMOSE](https://github.com/opencitations/ramose), the *Restful API Manager Over SPARQL Endpoints* created by [Silvio Peroni](https://orcid.org/0000-0003-0530-4305), which is licensed with an [ISC license](https://opensource.org/licenses/ISC).
-#endpoint http://virtuoso-service.default.svc.cluster.local:8890/sparql
+#endpoint http://meta-qlever-service.default.svc.cluster.local:7011
#method post
#addon metaapi
@@ -65,247 +65,243 @@ It is possible to specify one or more IDs as input of this operation. In this ca
"editor": "Allan, Catherine [orcid:0000-0003-2098-4759 omid:ra/069012996]; Stankey, George H. [omid:ra/061808486861]"
}
]
-#sparql PREFIX foaf:
-PREFIX pro:
+#sparql PREFIX datacite:
+PREFIX fabio:
PREFIX literal:
+
+SELECT DISTINCT ?res
+WHERE {
+ [[ids]]
+}
+
+@@join ?res ?res type=left
+@@values ?res
PREFIX datacite:
PREFIX dcterm:
-PREFIX frbr:
+PREFIX literal:
+PREFIX prism:
+
+SELECT ?res ?title ?pub_date
+(CONCAT(COALESCE(GROUP_CONCAT(DISTINCT ?external_id; SEPARATOR=""), ""), "omid:br/", STRAFTER(STR(?res), "/br/")) AS ?id)
+WHERE {
+ OPTIONAL { ?res dcterm:title ?title }
+ OPTIONAL { ?res prism:publicationDate ?pub_date }
+ OPTIONAL { ?res datacite:hasIdentifier ?identifier }
+ BIND(COALESCE(?identifier, ) AS ?identifier_node)
+ OPTIONAL { ?identifier_node datacite:usesIdentifierScheme ?scheme }
+ OPTIONAL { ?identifier_node literal:hasLiteralValue ?literal_value }
+ BIND(CONCAT(STRAFTER(STR(?scheme), "http://purl.org/spar/datacite/"), ":", ?literal_value, " ") AS ?external_id)
+}
+GROUP BY ?res ?title ?pub_date
+
+@@join ?res ?res type=left
+@@values ?res
PREFIX fabio:
+
+SELECT DISTINCT ?res ?type
+WHERE {
+ ?res a ?type.
+ FILTER(?type != fabio:Expression)
+}
+
+@@join ?res ?res type=left
+@@values ?res
+PREFIX frbr:
PREFIX prism:
+
+SELECT DISTINCT ?res ?page
+WHERE {
+ ?res frbr:embodiment ?embodiment.
+ ?embodiment prism:startingPage ?starting_page;
+ prism:endingPage ?ending_page.
+ BIND(IF(STR(?starting_page) = STR(?ending_page), STR(?starting_page), CONCAT(?starting_page, "-", ?ending_page)) AS ?page)
+}
+
+@@join ?res ?res type=left
+@@values ?res
+PREFIX fabio:
+PREFIX frbr:
+
+SELECT DISTINCT ?res ?issue
+WHERE {
+ ?res frbr:partOf ?journal_issue.
+ ?journal_issue a fabio:JournalIssue;
+ fabio:hasSequenceIdentifier ?issue.
+}
+
+@@join ?res ?res type=left
+@@values ?res
+PREFIX fabio:
+PREFIX frbr:
+
+SELECT DISTINCT ?res ?volume
+WHERE {
+ ?res frbr:partOf+ ?journal_volume.
+ ?journal_volume a fabio:JournalVolume;
+ fabio:hasSequenceIdentifier ?volume.
+}
+
+@@join ?res ?res type=left
+@@values ?res
+PREFIX datacite:
+PREFIX dcterm:
+PREFIX fabio:
+PREFIX frbr:
+PREFIX literal:
+
+SELECT ?res
+(CONCAT(?venue_name, " [", COALESCE(GROUP_CONCAT(DISTINCT ?venue_external_id; SEPARATOR=""), ""), "omid:br/", STRAFTER(STR(?venue_resource), "/br/"), "]") AS ?venue)
+WHERE {
+ ?res frbr:partOf ?direct_container;
+ frbr:partOf+ ?venue_resource.
+ ?venue_resource dcterm:title ?venue_name.
+ FILTER(?venue_resource = ?direct_container || (EXISTS { ?res a fabio:JournalArticle } && EXISTS { ?venue_resource a fabio:Journal }))
+ OPTIONAL { ?venue_resource datacite:hasIdentifier ?venue_identifier }
+ BIND(COALESCE(?venue_identifier, ) AS ?venue_identifier_node)
+ OPTIONAL { ?venue_identifier_node datacite:usesIdentifierScheme ?venue_scheme }
+ OPTIONAL { ?venue_identifier_node literal:hasLiteralValue ?venue_literal_value }
+ BIND(CONCAT(STRAFTER(STR(?venue_scheme), "http://purl.org/spar/datacite/"), ":", ?venue_literal_value, " ") AS ?venue_external_id)
+}
+GROUP BY ?res ?venue_resource ?venue_name
+
+@@join ?res ?res type=left
+@@values ?res
+PREFIX datacite:
+PREFIX foaf:
+PREFIX literal:
PREFIX oco:
+PREFIX pro:
-SELECT DISTINCT
-?id
-(STR(?title) AS ?title)
-(GROUP_CONCAT(DISTINCT ?author_info; SEPARATOR="|") AS ?author)
-(STR(?pub_date) AS ?pub_date)
-(STR(?issue) AS ?issue)
-(STR(?volume) AS ?volume)
-?venue
-?type
-?page
-(GROUP_CONCAT(DISTINCT ?publisher_info; SEPARATOR="|") AS ?publisher)
-(GROUP_CONCAT(DISTINCT ?combined_editor_info; SEPARATOR="|") AS ?editor)
+SELECT ?res (GROUP_CONCAT(DISTINCT ?agent_info; SEPARATOR="|") AS ?author)
WHERE {
- {
- SELECT ?res ?title ?author_info ?combined_editor_info ?publisher_info ?type ?pub_date ?page ?issue ?volume ?venueName ?venueMetaid
- (GROUP_CONCAT(DISTINCT ?id ; SEPARATOR=" ") AS ?ids)
- (GROUP_CONCAT(DISTINCT ?venue_ids_; SEPARATOR=' ') AS ?venue_ids)
- WHERE {
- [[ids]]
- OPTIONAL {
- ?res datacite:hasIdentifier ?allIdentifiers.
- ?allIdentifiers datacite:usesIdentifierScheme ?allSchemes;
- literal:hasLiteralValue ?allLiteralValues.
- BIND(CONCAT(STRAFTER(STR(?allSchemes), "http://purl.org/spar/datacite/"), ":", ?allLiteralValues) AS ?id)
- }
- OPTIONAL {
- ?res pro:isDocumentContextFor ?arAuthor.
- ?arAuthor pro:withRole pro:author;
- pro:isHeldBy ?raAuthor.
- OPTIONAL {
- ?arAuthor oco:hasNext ?nextAuthorRole .
- }
- BIND(STRAFTER(STR(?arAuthor), "https://w3id.org/oc/meta/ar/") AS ?roleUri)
- BIND(STRAFTER(STR(?nextAuthorRole), "https://w3id.org/oc/meta/ar/") AS ?nextRoleUri)
- BIND(CONCAT("omid:ra/", STRAFTER(STR(?raAuthor), "/ra/")) AS ?author_metaid)
- OPTIONAL {?raAuthor foaf:familyName ?familyName.}
- OPTIONAL {?raAuthor foaf:givenName ?givenName.}
- OPTIONAL {?raAuthor foaf:name ?name.}
- OPTIONAL {
- ?raAuthor datacite:hasIdentifier ?authorIdentifier.
- ?authorIdentifier datacite:usesIdentifierScheme ?authorIdSchema;
- literal:hasLiteralValue ?authorIdLiteralValue.
- BIND(CONCAT(STRAFTER(STR(?authorIdSchema), "http://purl.org/spar/datacite/"), ":", ?authorIdLiteralValue) AS ?author_id)
- }
- BIND(
- IF(
- STRLEN(STR(?familyName)) > 0 && STRLEN(STR(?givenName)) > 0,
- CONCAT(?familyName, ", ", ?givenName),
- IF(
- STRLEN(STR(?familyName)) > 0,
- CONCAT(?familyName, ","),
- ?name
- )
- )
- AS ?authorName)
- BIND(
- IF(
- STRLEN(STR(?author_id)) > 0,
- CONCAT(?authorName, " [", ?author_id, " ", ?author_metaid, "]"),
- CONCAT(?authorName, " [", ?author_metaid, "]")
- )
- AS ?author_)
- BIND(CONCAT(?author_, ":", ?roleUri, ":", COALESCE(?nextRoleUri, "")) AS ?author_info)
- }
- OPTIONAL {
- ?res pro:isDocumentContextFor ?arEditor.
- ?arEditor pro:withRole pro:editor;
- pro:isHeldBy ?raEditor.
- OPTIONAL {
- ?arEditor oco:hasNext ?nextEditorRole .
- }
- BIND(STRAFTER(STR(?arEditor), "https://w3id.org/oc/meta/ar/") AS ?editorRoleUri)
- BIND(STRAFTER(STR(?nextEditorRole), "https://w3id.org/oc/meta/ar/") AS ?nextEditorRoleUri)
- BIND(CONCAT("omid:ra/", STRAFTER(STR(?raEditor), "/ra/")) AS ?editor_metaid)
- OPTIONAL {?raEditor foaf:familyName ?editorFamilyName.}
- OPTIONAL {?raEditor foaf:givenName ?editorGivenName.}
- OPTIONAL {?raEditor foaf:name ?editor_name.}
- OPTIONAL {
- ?raEditor datacite:hasIdentifier ?editorIdentifier.
- ?editorIdentifier datacite:usesIdentifierScheme ?editorIdSchema;
- literal:hasLiteralValue ?editorIdLiteralValue.
- BIND(CONCAT(STRAFTER(STR(?editorIdSchema), "http://purl.org/spar/datacite/"), ":", ?editorIdLiteralValue) AS ?editor_id)
- }
- BIND(
- IF(
- STRLEN(STR(?editorFamilyName)) > 0 && STRLEN(STR(?editorGivenName)) > 0,
- CONCAT(?editorFamilyName, ", ", ?editorGivenName),
- IF(
- STRLEN(STR(?editorFamilyName)) > 0,
- CONCAT(?editorFamilyName, ","),
- ?editor_name
- )
- )
- AS ?editorName)
- BIND(
- IF(
- STRLEN(STR(?editor_id)) > 0,
- CONCAT(?editorName, " [", ?editor_id, " ", ?editor_metaid, "]"),
- CONCAT(?editorName, " [", ?editor_metaid, "]")
- )
- AS ?editor_)
- BIND(CONCAT(?editor_, ":", ?editorRoleUri, ":", COALESCE(?nextEditorRoleUri, "")) AS ?editor_info)
- }
- OPTIONAL {
- ?res frbr:partOf ?container.
- ?container pro:isDocumentContextFor ?arContainerEditor.
- ?arContainerEditor pro:withRole pro:editor;
- pro:isHeldBy ?raContainerEditor.
- OPTIONAL {
- ?arContainerEditor oco:hasNext ?nextContainerEditorRole .
- }
- BIND(STRAFTER(STR(?arContainerEditor), "https://w3id.org/oc/meta/ar/") AS ?containerEditorRoleUri)
- BIND(STRAFTER(STR(?nextContainerEditorRole), "https://w3id.org/oc/meta/ar/") AS ?nextContainerEditorRoleUri)
- BIND(CONCAT("omid:ra/", STRAFTER(STR(?raContainerEditor), "/ra/")) AS ?container_editor_metaid)
- OPTIONAL {?raContainerEditor foaf:familyName ?containerEditorFamilyName.}
- OPTIONAL {?raContainerEditor foaf:givenName ?containerEditorGivenName.}
- OPTIONAL {?raContainerEditor foaf:name ?container_editor_name.}
- OPTIONAL {
- ?raContainerEditor datacite:hasIdentifier ?containerEditorIdentifier.
- ?containerEditorIdentifier datacite:usesIdentifierScheme ?containerEditorIdSchema;
- literal:hasLiteralValue ?containerEditorIdLiteralValue.
- BIND(CONCAT(STRAFTER(STR(?containerEditorIdSchema), "http://purl.org/spar/datacite/"), ":", ?containerEditorIdLiteralValue) AS ?container_editor_id)
- }
- BIND(
- IF(
- STRLEN(STR(?containerEditorFamilyName)) > 0 && STRLEN(STR(?containerEditorGivenName)) > 0,
- CONCAT(?containerEditorFamilyName, ", ", ?containerEditorGivenName),
- IF(
- STRLEN(STR(?containerEditorFamilyName)) > 0,
- CONCAT(?containerEditorFamilyName, ","),
- ?container_editor_name
- )
- )
- AS ?containerEditorName)
- BIND(
- IF(
- STRLEN(STR(?container_editor_id)) > 0,
- CONCAT(?containerEditorName, " [", ?container_editor_id, " ", ?container_editor_metaid, "]"),
- CONCAT(?containerEditorName, " [", ?container_editor_metaid, "]")
- )
- AS ?container_editor_)
- BIND(CONCAT(?container_editor_, ":", ?containerEditorRoleUri, ":", COALESCE(?nextContainerEditorRoleUri, "")) AS ?container_editor_info)
- }
- BIND(
- IF(BOUND(?editor_info),
- IF(BOUND(?container_editor_info),
- CONCAT(?editor_info, "|", ?container_editor_info),
- ?editor_info),
- IF(BOUND(?container_editor_info),
- ?container_editor_info,
- "")
- )
- AS ?combined_editor_info)
- OPTIONAL {
- ?res pro:isDocumentContextFor ?arPublisher.
- ?arPublisher pro:withRole pro:publisher;
- pro:isHeldBy ?raPublisher.
- OPTIONAL {
- ?arPublisher oco:hasNext ?nextPublisherRole .
- }
- BIND(STRAFTER(STR(?arPublisher), "https://w3id.org/oc/meta/ar/") AS ?publisherRoleUri)
- BIND(STRAFTER(STR(?nextPublisherRole), "https://w3id.org/oc/meta/ar/") AS ?nextPublisherRoleUri)
- ?raPublisher foaf:name ?publisherName_.
- BIND(CONCAT("omid:ra/", STRAFTER(STR(?raPublisher), "/ra/")) AS ?publisher_metaid)
- ?raPublisher foaf:name ?publisher_name.
- OPTIONAL {
- ?raPublisher datacite:hasIdentifier ?publisherIdentifier__.
- ?publisherIdentifier__ datacite:usesIdentifierScheme ?publisherIdSchema;
- literal:hasLiteralValue ?publisherIdLiteralValue.
- BIND(CONCAT(STRAFTER(STR(?publisherIdSchema), "http://purl.org/spar/datacite/"), ":", ?publisherIdLiteralValue) AS ?publisher_id)
- }
- BIND(
- IF(
- STRLEN(STR(?publisher_id)) > 0,
- CONCAT(?publisher_name, " [", ?publisher_id, " ", ?publisher_metaid, "]"),
- CONCAT(?publisher_name, " [", ?publisher_metaid, "]")
- )
- AS ?publisher_)
- BIND(CONCAT(?publisher_, ":", ?publisherRoleUri, ":", COALESCE(?nextPublisherRoleUri, "")) AS ?publisher_info)
- }
- OPTIONAL {
- {
- ?res a fabio:JournalArticle;
- frbr:partOf+ ?journal.
- BIND(CONCAT("omid:br/", STRAFTER(STR(?journal), "/br/")) AS ?venueMetaid)
- ?journal a fabio:Journal.
- } UNION {
- ?res frbr:partOf ?journal.
- BIND(CONCAT("omid:br/", STRAFTER(STR(?journal), "/br/")) AS ?venueMetaid)
- }
- ?journal dcterm:title ?venueName.
- OPTIONAL {
- ?journal datacite:hasIdentifier ?journalIdentifier__.
- ?journalIdentifier__ datacite:usesIdentifierScheme ?journalIdScheme;
- literal:hasLiteralValue ?journalIdLiteralValue.
- BIND(CONCAT(STRAFTER(STR(?journalIdScheme), "http://purl.org/spar/datacite/"), ":", ?journalIdLiteralValue) AS ?venue_ids_)
- }
- }
- OPTIONAL {?res a ?type. FILTER (?type != fabio:Expression)}
- OPTIONAL {?res dcterm:title ?title.}
- OPTIONAL {?res prism:publicationDate ?pub_date.}
- OPTIONAL {
- ?res frbr:embodiment ?re.
- ?re prism:startingPage ?startingPage;
- prism:endingPage ?endingPage.
- BIND(IF(STR(?startingPage) = STR(?endingPage), STR(?startingPage), CONCAT(?startingPage, '-', ?endingPage)) AS ?page)
- }
- OPTIONAL {
- ?res frbr:partOf ?resIssue.
- ?resIssue a fabio:JournalIssue;
- fabio:hasSequenceIdentifier ?issue.
- }
- OPTIONAL {
- ?res frbr:partOf+ ?resVolume.
- ?resVolume a fabio:JournalVolume;
- fabio:hasSequenceIdentifier ?volume.
- }
- } GROUP BY ?res ?title ?author_info ?combined_editor_info ?publisher_info ?type ?issue ?volume ?pub_date ?page ?venueName ?venueMetaid
- }
- BIND(CONCAT(?ids, IF(STR(?ids) != "", " ", ""), "omid:br/", STRAFTER(STR(?res), "/br/")) AS ?id)
+ ?res pro:isDocumentContextFor ?agent_role.
+ ?agent_role pro:withRole pro:author;
+ pro:isHeldBy ?agent.
+ OPTIONAL { ?agent_role oco:hasNext ?next_agent_role }
+ OPTIONAL { ?agent foaf:familyName ?family_name }
+ OPTIONAL { ?agent foaf:givenName ?given_name }
+ OPTIONAL { ?agent foaf:name ?name }
+ OPTIONAL { ?agent datacite:hasIdentifier ?agent_identifier }
+ BIND(COALESCE(?agent_identifier, ) AS ?agent_identifier_node)
+ OPTIONAL { ?agent_identifier_node datacite:usesIdentifierScheme ?agent_scheme }
+ OPTIONAL { ?agent_identifier_node literal:hasLiteralValue ?agent_literal_value }
+ BIND(CONCAT(STRAFTER(STR(?agent_scheme), "http://purl.org/spar/datacite/"), ":", ?agent_literal_value) AS ?agent_id)
+ BIND(CONCAT("omid:ra/", STRAFTER(STR(?agent), "/ra/")) AS ?agent_omid)
+ BIND(
+ IF(
+ BOUND(?family_name) && BOUND(?given_name),
+ CONCAT(?family_name, ", ", ?given_name),
+ IF(
+ BOUND(?family_name),
+ CONCAT(?family_name, ","),
+ ?name
+ )
+ )
+ AS ?agent_name)
+ BIND(
+ IF(
+ BOUND(?agent_id),
+ CONCAT(?agent_name, " [", ?agent_id, " ", ?agent_omid, "]"),
+ CONCAT(?agent_name, " [", ?agent_omid, "]")
+ )
+ AS ?agent_label)
+ BIND(CONCAT(?agent_label, ":", STRAFTER(STR(?agent_role), "/ar/"), ":", COALESCE(STRAFTER(STR(?next_agent_role), "/ar/"), "")) AS ?agent_info)
+}
+GROUP BY ?res
+
+@@join ?res ?res type=left
+@@values ?res
+PREFIX datacite:
+PREFIX foaf:
+PREFIX frbr:
+PREFIX literal:
+PREFIX oco:
+PREFIX pro:
+
+SELECT ?res (GROUP_CONCAT(DISTINCT ?agent_info; SEPARATOR="|") AS ?editor)
+WHERE {
+ OPTIONAL { ?res frbr:partOf ?container }
+ VALUES ?of_container { false true }
+ BIND(IF(?of_container, COALESCE(?container, ), ?res) AS ?context)
+ ?context pro:isDocumentContextFor ?agent_role.
+ ?agent_role pro:withRole pro:editor;
+ pro:isHeldBy ?agent.
+ OPTIONAL { ?agent_role oco:hasNext ?next_agent_role }
+ OPTIONAL { ?agent foaf:familyName ?family_name }
+ OPTIONAL { ?agent foaf:givenName ?given_name }
+ OPTIONAL { ?agent foaf:name ?name }
+ OPTIONAL { ?agent datacite:hasIdentifier ?agent_identifier }
+ BIND(COALESCE(?agent_identifier, ) AS ?agent_identifier_node)
+ OPTIONAL { ?agent_identifier_node datacite:usesIdentifierScheme ?agent_scheme }
+ OPTIONAL { ?agent_identifier_node literal:hasLiteralValue ?agent_literal_value }
+ BIND(CONCAT(STRAFTER(STR(?agent_scheme), "http://purl.org/spar/datacite/"), ":", ?agent_literal_value) AS ?agent_id)
+ BIND(CONCAT("omid:ra/", STRAFTER(STR(?agent), "/ra/")) AS ?agent_omid)
BIND(
- IF(BOUND(?venueMetaid),
- IF(STR(?venue_ids) != "",
- CONCAT(" [", ?venue_ids, " ", ?venueMetaid, "]"),
- CONCAT(" [", ?venueMetaid, "]")
- ),
- ""
+ IF(
+ BOUND(?family_name) && BOUND(?given_name),
+ CONCAT(?family_name, ", ", ?given_name),
+ IF(
+ BOUND(?family_name),
+ CONCAT(?family_name, ","),
+ ?name
+ )
)
- AS ?venueIdentifiers)
- BIND(CONCAT(?venueName, ?venueIdentifiers) AS ?venue)
-} GROUP BY ?id ?title ?type ?issue ?volume ?venue ?pub_date ?page
+ AS ?agent_name)
+ BIND(
+ IF(
+ BOUND(?agent_id),
+ CONCAT(?agent_name, " [", ?agent_id, " ", ?agent_omid, "]"),
+ CONCAT(?agent_name, " [", ?agent_omid, "]")
+ )
+ AS ?agent_label)
+ BIND(CONCAT(?agent_label, ":", STRAFTER(STR(?agent_role), "/ar/"), ":", COALESCE(STRAFTER(STR(?next_agent_role), "/ar/"), "")) AS ?agent_info)
+}
+GROUP BY ?res
+
+@@join ?res ?res type=left
+@@values ?res
+PREFIX datacite:
+PREFIX foaf:
+PREFIX literal:
+PREFIX oco:
+PREFIX pro:
+
+SELECT ?res (GROUP_CONCAT(DISTINCT ?agent_info; SEPARATOR="|") AS ?publisher)
+WHERE {
+ ?res pro:isDocumentContextFor ?agent_role.
+ ?agent_role pro:withRole pro:publisher;
+ pro:isHeldBy ?agent.
+ OPTIONAL { ?agent_role oco:hasNext ?next_agent_role }
+ OPTIONAL { ?agent foaf:familyName ?family_name }
+ OPTIONAL { ?agent foaf:givenName ?given_name }
+ OPTIONAL { ?agent foaf:name ?name }
+ OPTIONAL { ?agent datacite:hasIdentifier ?agent_identifier }
+ BIND(COALESCE(?agent_identifier, ) AS ?agent_identifier_node)
+ OPTIONAL { ?agent_identifier_node datacite:usesIdentifierScheme ?agent_scheme }
+ OPTIONAL { ?agent_identifier_node literal:hasLiteralValue ?agent_literal_value }
+ BIND(CONCAT(STRAFTER(STR(?agent_scheme), "http://purl.org/spar/datacite/"), ":", ?agent_literal_value) AS ?agent_id)
+ BIND(CONCAT("omid:ra/", STRAFTER(STR(?agent), "/ra/")) AS ?agent_omid)
+ BIND(
+ IF(
+ BOUND(?family_name) && BOUND(?given_name),
+ CONCAT(?family_name, ", ", ?given_name),
+ IF(
+ BOUND(?family_name),
+ CONCAT(?family_name, ","),
+ ?name
+ )
+ )
+ AS ?agent_name)
+ BIND(
+ IF(
+ BOUND(?agent_id),
+ CONCAT(?agent_name, " [", ?agent_id, " ", ?agent_omid, "]"),
+ CONCAT(?agent_name, " [", ?agent_omid, "]")
+ )
+ AS ?agent_label)
+ BIND(CONCAT(?agent_label, ":", STRAFTER(STR(?agent_role), "/ar/"), ":", COALESCE(STRAFTER(STR(?next_agent_role), "/ar/"), "")) AS ?agent_info)
+}
+GROUP BY ?res
#url /author/{id}
#type operation
@@ -371,254 +367,248 @@ The fields returned by this operation are:
"editor": ""
}
]
-#sparql PREFIX foaf:
-PREFIX pro:
+#sparql PREFIX datacite:
+PREFIX fabio:
PREFIX literal:
+PREFIX pro:
+
+SELECT DISTINCT ?res
+WHERE {
+ [[id]]
+ ?knownRole pro:withRole pro:author.
+ ?res pro:isDocumentContextFor ?knownRole;
+ a fabio:Expression.
+}
+LIMIT 1000
+
+@@join ?res ?res type=left
+@@values ?res
PREFIX datacite:
PREFIX dcterm:
-PREFIX frbr:
+PREFIX literal:
+PREFIX prism:
+
+SELECT ?res ?title ?pub_date
+(CONCAT(COALESCE(GROUP_CONCAT(DISTINCT ?external_id; SEPARATOR=""), ""), "omid:br/", STRAFTER(STR(?res), "/br/")) AS ?id)
+WHERE {
+ OPTIONAL { ?res dcterm:title ?title }
+ OPTIONAL { ?res prism:publicationDate ?pub_date }
+ OPTIONAL { ?res datacite:hasIdentifier ?identifier }
+ BIND(COALESCE(?identifier, ) AS ?identifier_node)
+ OPTIONAL { ?identifier_node datacite:usesIdentifierScheme ?scheme }
+ OPTIONAL { ?identifier_node literal:hasLiteralValue ?literal_value }
+ BIND(CONCAT(STRAFTER(STR(?scheme), "http://purl.org/spar/datacite/"), ":", ?literal_value, " ") AS ?external_id)
+}
+GROUP BY ?res ?title ?pub_date
+
+@@join ?res ?res type=left
+@@values ?res
PREFIX fabio:
+
+SELECT DISTINCT ?res ?type
+WHERE {
+ ?res a ?type.
+ FILTER(?type != fabio:Expression)
+}
+
+@@join ?res ?res type=left
+@@values ?res
+PREFIX frbr:
PREFIX prism:
+
+SELECT DISTINCT ?res ?page
+WHERE {
+ ?res frbr:embodiment ?embodiment.
+ ?embodiment prism:startingPage ?starting_page;
+ prism:endingPage ?ending_page.
+ BIND(IF(STR(?starting_page) = STR(?ending_page), STR(?starting_page), CONCAT(?starting_page, "-", ?ending_page)) AS ?page)
+}
+
+@@join ?res ?res type=left
+@@values ?res
+PREFIX fabio:
+PREFIX frbr:
+
+SELECT DISTINCT ?res ?issue
+WHERE {
+ ?res frbr:partOf ?journal_issue.
+ ?journal_issue a fabio:JournalIssue;
+ fabio:hasSequenceIdentifier ?issue.
+}
+
+@@join ?res ?res type=left
+@@values ?res
+PREFIX fabio:
+PREFIX frbr:
+
+SELECT DISTINCT ?res ?volume
+WHERE {
+ ?res frbr:partOf+ ?journal_volume.
+ ?journal_volume a fabio:JournalVolume;
+ fabio:hasSequenceIdentifier ?volume.
+}
+
+@@join ?res ?res type=left
+@@values ?res
+PREFIX datacite:
+PREFIX dcterm:
+PREFIX fabio:
+PREFIX frbr:
+PREFIX literal:
+
+SELECT ?res
+(CONCAT(?venue_name, " [", COALESCE(GROUP_CONCAT(DISTINCT ?venue_external_id; SEPARATOR=""), ""), "omid:br/", STRAFTER(STR(?venue_resource), "/br/"), "]") AS ?venue)
+WHERE {
+ ?res frbr:partOf ?direct_container;
+ frbr:partOf+ ?venue_resource.
+ ?venue_resource dcterm:title ?venue_name.
+ FILTER(?venue_resource = ?direct_container || (EXISTS { ?res a fabio:JournalArticle } && EXISTS { ?venue_resource a fabio:Journal }))
+ OPTIONAL { ?venue_resource datacite:hasIdentifier ?venue_identifier }
+ BIND(COALESCE(?venue_identifier, ) AS ?venue_identifier_node)
+ OPTIONAL { ?venue_identifier_node datacite:usesIdentifierScheme ?venue_scheme }
+ OPTIONAL { ?venue_identifier_node literal:hasLiteralValue ?venue_literal_value }
+ BIND(CONCAT(STRAFTER(STR(?venue_scheme), "http://purl.org/spar/datacite/"), ":", ?venue_literal_value, " ") AS ?venue_external_id)
+}
+GROUP BY ?res ?venue_resource ?venue_name
+
+@@join ?res ?res type=left
+@@values ?res
+PREFIX datacite:
+PREFIX foaf:
+PREFIX literal:
PREFIX oco:
+PREFIX pro:
-SELECT DISTINCT
-?id
-(STR(?title) AS ?title)
-(GROUP_CONCAT(DISTINCT ?author_info; SEPARATOR="|") AS ?author)
-(STR(?pub_date) AS ?pub_date)
-(STR(?issue) AS ?issue)
-(STR(?volume) AS ?volume)
-?venue
-?type
-?page
-(GROUP_CONCAT(DISTINCT ?publisher_info; SEPARATOR="|") AS ?publisher)
-(GROUP_CONCAT(DISTINCT ?combined_editor_info; SEPARATOR="|") AS ?editor)
+SELECT ?res (GROUP_CONCAT(DISTINCT ?agent_info; SEPARATOR="|") AS ?author)
WHERE {
- {
- SELECT ?res ?title ?author_info ?combined_editor_info ?publisher_info ?type ?pub_date ?page ?issue ?volume ?venueName ?venueMetaid
- (GROUP_CONCAT(DISTINCT ?id ; SEPARATOR=" ") AS ?ids)
- (GROUP_CONCAT(DISTINCT ?venue_ids_; SEPARATOR=' ') AS ?venue_ids)
- WHERE {
- {
- SELECT DISTINCT ?res
- WHERE {
- [[id]]
- ?knownRole pro:withRole pro:author.
- ?res pro:isDocumentContextFor ?knownRole;
- a fabio:Expression.
- } LIMIT 1000
- }
- OPTIONAL {
- ?res datacite:hasIdentifier ?identifier.
- ?identifier datacite:usesIdentifierScheme ?scheme;
- literal:hasLiteralValue ?literalValue.
- BIND(CONCAT(STRAFTER(STR(?scheme), "http://purl.org/spar/datacite/"), ":", ?literalValue) AS ?id)
- }
- OPTIONAL {
- ?res pro:isDocumentContextFor ?arAuthor.
- ?arAuthor pro:withRole pro:author;
- pro:isHeldBy ?raAuthor.
- OPTIONAL {
- ?arAuthor oco:hasNext ?nextAuthorRole .
- }
- BIND(STRAFTER(STR(?arAuthor), "https://w3id.org/oc/meta/ar/") AS ?roleUri)
- BIND(STRAFTER(STR(?nextAuthorRole), "https://w3id.org/oc/meta/ar/") AS ?nextRoleUri)
- BIND(CONCAT("omid:ra/", STRAFTER(STR(?raAuthor), "/ra/")) AS ?author_metaid)
- OPTIONAL {?raAuthor foaf:familyName ?familyName.}
- OPTIONAL {?raAuthor foaf:givenName ?givenName.}
- OPTIONAL {?raAuthor foaf:name ?name.}
- OPTIONAL {
- ?raAuthor datacite:hasIdentifier ?authorIdentifier.
- ?authorIdentifier datacite:usesIdentifierScheme ?authorIdSchema;
- literal:hasLiteralValue ?authorIdLiteralValue.
- BIND(CONCAT(STRAFTER(STR(?authorIdSchema), "http://purl.org/spar/datacite/"), ":", ?authorIdLiteralValue) AS ?author_id)
- }
- BIND(
- IF(
- STRLEN(STR(?familyName)) > 0 && STRLEN(STR(?givenName)) > 0,
- CONCAT(?familyName, ", ", ?givenName),
- IF(
- STRLEN(STR(?familyName)) > 0,
- CONCAT(?familyName, ","),
- ?name
- )
- )
- AS ?authorName)
- BIND(
- IF(
- STRLEN(STR(?author_id)) > 0,
- CONCAT(?authorName, " [", ?author_id, " ", ?author_metaid, "]"),
- CONCAT(?authorName, " [", ?author_metaid, "]")
- )
- AS ?author_)
- BIND(CONCAT(?author_, ":", ?roleUri, ":", COALESCE(?nextRoleUri, "")) AS ?author_info)
- }
- OPTIONAL {
- ?res pro:isDocumentContextFor ?arEditor.
- ?arEditor pro:withRole pro:editor;
- pro:isHeldBy ?raEditor.
- OPTIONAL {
- ?arEditor oco:hasNext ?nextEditorRole .
- }
- BIND(STRAFTER(STR(?arEditor), "https://w3id.org/oc/meta/ar/") AS ?editorRoleUri)
- BIND(STRAFTER(STR(?nextEditorRole), "https://w3id.org/oc/meta/ar/") AS ?nextEditorRoleUri)
- BIND(CONCAT("omid:ra/", STRAFTER(STR(?raEditor), "/ra/")) AS ?editor_metaid)
- OPTIONAL {?raEditor foaf:familyName ?editorFamilyName.}
- OPTIONAL {?raEditor foaf:givenName ?editorGivenName.}
- OPTIONAL {?raEditor foaf:name ?editor_name.}
- OPTIONAL {
- ?raEditor datacite:hasIdentifier ?editorIdentifier.
- ?editorIdentifier datacite:usesIdentifierScheme ?editorIdSchema;
- literal:hasLiteralValue ?editorIdLiteralValue.
- BIND(CONCAT(STRAFTER(STR(?editorIdSchema), "http://purl.org/spar/datacite/"), ":", ?editorIdLiteralValue) AS ?editor_id)
- }
- BIND(
- IF(
- STRLEN(STR(?editorFamilyName)) > 0 && STRLEN(STR(?editorGivenName)) > 0,
- CONCAT(?editorFamilyName, ", ", ?editorGivenName),
- IF(
- STRLEN(STR(?editorFamilyName)) > 0,
- CONCAT(?editorFamilyName, ","),
- ?editor_name
- )
- )
- AS ?editorName)
- BIND(
- IF(
- STRLEN(STR(?editor_id)) > 0,
- CONCAT(?editorName, " [", ?editor_id, " ", ?editor_metaid, "]"),
- CONCAT(?editorName, " [", ?editor_metaid, "]")
- )
- AS ?editor_)
- BIND(CONCAT(?editor_, ":", ?editorRoleUri, ":", COALESCE(?nextEditorRoleUri, "")) AS ?editor_info)
- }
- OPTIONAL {
- ?res frbr:partOf ?container.
- ?container pro:isDocumentContextFor ?arContainerEditor.
- ?arContainerEditor pro:withRole pro:editor;
- pro:isHeldBy ?raContainerEditor.
- OPTIONAL {
- ?arContainerEditor oco:hasNext ?nextContainerEditorRole .
- }
- BIND(STRAFTER(STR(?arContainerEditor), "https://w3id.org/oc/meta/ar/") AS ?containerEditorRoleUri)
- BIND(STRAFTER(STR(?nextContainerEditorRole), "https://w3id.org/oc/meta/ar/") AS ?nextContainerEditorRoleUri)
- BIND(CONCAT("omid:ra/", STRAFTER(STR(?raContainerEditor), "/ra/")) AS ?container_editor_metaid)
- OPTIONAL {?raContainerEditor foaf:familyName ?containerEditorFamilyName.}
- OPTIONAL {?raContainerEditor foaf:givenName ?containerEditorGivenName.}
- OPTIONAL {?raContainerEditor foaf:name ?container_editor_name.}
- OPTIONAL {
- ?raContainerEditor datacite:hasIdentifier ?containerEditorIdentifier.
- ?containerEditorIdentifier datacite:usesIdentifierScheme ?containerEditorIdSchema;
- literal:hasLiteralValue ?containerEditorIdLiteralValue.
- BIND(CONCAT(STRAFTER(STR(?containerEditorIdSchema), "http://purl.org/spar/datacite/"), ":", ?containerEditorIdLiteralValue) AS ?container_editor_id)
- }
- BIND(
- IF(
- STRLEN(STR(?containerEditorFamilyName)) > 0 && STRLEN(STR(?containerEditorGivenName)) > 0,
- CONCAT(?containerEditorFamilyName, ", ", ?containerEditorGivenName),
- IF(
- STRLEN(STR(?containerEditorFamilyName)) > 0,
- CONCAT(?containerEditorFamilyName, ","),
- ?container_editor_name
- )
- )
- AS ?containerEditorName)
- BIND(
- IF(
- STRLEN(STR(?container_editor_id)) > 0,
- CONCAT(?containerEditorName, " [", ?container_editor_id, " ", ?container_editor_metaid, "]"),
- CONCAT(?containerEditorName, " [", ?container_editor_metaid, "]")
- )
- AS ?container_editor_)
- BIND(CONCAT(?container_editor_, ":", ?containerEditorRoleUri, ":", COALESCE(?nextContainerEditorRoleUri, "")) AS ?container_editor_info)
- }
- BIND(
- IF(BOUND(?editor_info),
- IF(BOUND(?container_editor_info),
- CONCAT(?editor_info, "|", ?container_editor_info),
- ?editor_info),
- IF(BOUND(?container_editor_info),
- ?container_editor_info,
- "")
- )
- AS ?combined_editor_info)
- OPTIONAL {
- ?res pro:isDocumentContextFor ?arPublisher.
- ?arPublisher pro:withRole pro:publisher;
- pro:isHeldBy ?raPublisher.
- OPTIONAL {
- ?arPublisher oco:hasNext ?nextPublisherRole .
- }
- BIND(STRAFTER(STR(?arPublisher), "https://w3id.org/oc/meta/ar/") AS ?publisherRoleUri)
- BIND(STRAFTER(STR(?nextPublisherRole), "https://w3id.org/oc/meta/ar/") AS ?nextPublisherRoleUri)
- BIND(CONCAT("omid:ra/", STRAFTER(STR(?raPublisher), "/ra/")) AS ?publisher_metaid)
- ?raPublisher foaf:name ?publisher_name.
- OPTIONAL {
- ?raPublisher datacite:hasIdentifier ?publisherIdentifier__.
- ?publisherIdentifier__ datacite:usesIdentifierScheme ?publisherIdSchema;
- literal:hasLiteralValue ?publisherIdLiteralValue.
- BIND(CONCAT(STRAFTER(STR(?publisherIdSchema), "http://purl.org/spar/datacite/"), ":", ?publisherIdLiteralValue) AS ?publisher_id)
- }
- BIND(
- IF(
- STRLEN(STR(?publisher_id)) > 0,
- CONCAT(?publisher_name, " [", ?publisher_id, " ", ?publisher_metaid, "]"),
- CONCAT(?publisher_name, " [", ?publisher_metaid, "]")
- )
- AS ?publisher_)
- BIND(CONCAT(?publisher_, ":", ?publisherRoleUri, ":", COALESCE(?nextPublisherRoleUri, "")) AS ?publisher_info)
- }
- OPTIONAL {
- {
- ?res a fabio:JournalArticle;
- frbr:partOf+ ?journal.
- BIND(CONCAT("omid:br/", STRAFTER(STR(?journal), "/br/")) AS ?venueMetaid)
- ?journal a fabio:Journal.
- } UNION {
- ?res frbr:partOf ?journal.
- BIND(CONCAT("omid:br/", STRAFTER(STR(?journal), "/br/")) AS ?venueMetaid)
- }
- ?journal dcterm:title ?venueName.
- OPTIONAL {
- ?journal datacite:hasIdentifier ?journalIdentifier__.
- ?journalIdentifier__ datacite:usesIdentifierScheme ?journalIdScheme;
- literal:hasLiteralValue ?journalIdLiteralValue.
- BIND(CONCAT(STRAFTER(STR(?journalIdScheme), "http://purl.org/spar/datacite/"), ":", ?journalIdLiteralValue) AS ?venue_ids_)
- }
- }
- OPTIONAL {?res a ?type. FILTER (?type != fabio:Expression)}
- OPTIONAL {?res dcterm:title ?title.}
- OPTIONAL {?res prism:publicationDate ?pub_date.}
- OPTIONAL {
- ?res frbr:embodiment ?re.
- ?re prism:startingPage ?startingPage;
- prism:endingPage ?endingPage.
- BIND(IF(STR(?startingPage) = STR(?endingPage), STR(?startingPage), CONCAT(?startingPage, '-', ?endingPage)) AS ?page)
- }
- OPTIONAL {
- ?res frbr:partOf ?resIssue.
- ?resIssue a fabio:JournalIssue;
- fabio:hasSequenceIdentifier ?issue.
- }
- OPTIONAL {
- ?res frbr:partOf+ ?resVolume.
- ?resVolume a fabio:JournalVolume;
- fabio:hasSequenceIdentifier ?volume.
- }
- } GROUP BY ?res ?title ?author_info ?combined_editor_info ?publisher_info ?type ?issue ?volume ?pub_date ?page ?venueName ?venueMetaid
- }
- BIND(CONCAT(?ids, IF(STR(?ids) != "", " ", ""), "omid:br/", STRAFTER(STR(?res), "/br/")) AS ?id)
+ ?res pro:isDocumentContextFor ?agent_role.
+ ?agent_role pro:withRole pro:author;
+ pro:isHeldBy ?agent.
+ OPTIONAL { ?agent_role oco:hasNext ?next_agent_role }
+ OPTIONAL { ?agent foaf:familyName ?family_name }
+ OPTIONAL { ?agent foaf:givenName ?given_name }
+ OPTIONAL { ?agent foaf:name ?name }
+ OPTIONAL { ?agent datacite:hasIdentifier ?agent_identifier }
+ BIND(COALESCE(?agent_identifier, ) AS ?agent_identifier_node)
+ OPTIONAL { ?agent_identifier_node datacite:usesIdentifierScheme ?agent_scheme }
+ OPTIONAL { ?agent_identifier_node literal:hasLiteralValue ?agent_literal_value }
+ BIND(CONCAT(STRAFTER(STR(?agent_scheme), "http://purl.org/spar/datacite/"), ":", ?agent_literal_value) AS ?agent_id)
+ BIND(CONCAT("omid:ra/", STRAFTER(STR(?agent), "/ra/")) AS ?agent_omid)
+ BIND(
+ IF(
+ BOUND(?family_name) && BOUND(?given_name),
+ CONCAT(?family_name, ", ", ?given_name),
+ IF(
+ BOUND(?family_name),
+ CONCAT(?family_name, ","),
+ ?name
+ )
+ )
+ AS ?agent_name)
+ BIND(
+ IF(
+ BOUND(?agent_id),
+ CONCAT(?agent_name, " [", ?agent_id, " ", ?agent_omid, "]"),
+ CONCAT(?agent_name, " [", ?agent_omid, "]")
+ )
+ AS ?agent_label)
+ BIND(CONCAT(?agent_label, ":", STRAFTER(STR(?agent_role), "/ar/"), ":", COALESCE(STRAFTER(STR(?next_agent_role), "/ar/"), "")) AS ?agent_info)
+}
+GROUP BY ?res
+
+@@join ?res ?res type=left
+@@values ?res
+PREFIX datacite:
+PREFIX foaf:
+PREFIX frbr:
+PREFIX literal:
+PREFIX oco:
+PREFIX pro:
+
+SELECT ?res (GROUP_CONCAT(DISTINCT ?agent_info; SEPARATOR="|") AS ?editor)
+WHERE {
+ OPTIONAL { ?res frbr:partOf ?container }
+ VALUES ?of_container { false true }
+ BIND(IF(?of_container, COALESCE(?container, ), ?res) AS ?context)
+ ?context pro:isDocumentContextFor ?agent_role.
+ ?agent_role pro:withRole pro:editor;
+ pro:isHeldBy ?agent.
+ OPTIONAL { ?agent_role oco:hasNext ?next_agent_role }
+ OPTIONAL { ?agent foaf:familyName ?family_name }
+ OPTIONAL { ?agent foaf:givenName ?given_name }
+ OPTIONAL { ?agent foaf:name ?name }
+ OPTIONAL { ?agent datacite:hasIdentifier ?agent_identifier }
+ BIND(COALESCE(?agent_identifier, ) AS ?agent_identifier_node)
+ OPTIONAL { ?agent_identifier_node datacite:usesIdentifierScheme ?agent_scheme }
+ OPTIONAL { ?agent_identifier_node literal:hasLiteralValue ?agent_literal_value }
+ BIND(CONCAT(STRAFTER(STR(?agent_scheme), "http://purl.org/spar/datacite/"), ":", ?agent_literal_value) AS ?agent_id)
+ BIND(CONCAT("omid:ra/", STRAFTER(STR(?agent), "/ra/")) AS ?agent_omid)
+ BIND(
+ IF(
+ BOUND(?family_name) && BOUND(?given_name),
+ CONCAT(?family_name, ", ", ?given_name),
+ IF(
+ BOUND(?family_name),
+ CONCAT(?family_name, ","),
+ ?name
+ )
+ )
+ AS ?agent_name)
+ BIND(
+ IF(
+ BOUND(?agent_id),
+ CONCAT(?agent_name, " [", ?agent_id, " ", ?agent_omid, "]"),
+ CONCAT(?agent_name, " [", ?agent_omid, "]")
+ )
+ AS ?agent_label)
+ BIND(CONCAT(?agent_label, ":", STRAFTER(STR(?agent_role), "/ar/"), ":", COALESCE(STRAFTER(STR(?next_agent_role), "/ar/"), "")) AS ?agent_info)
+}
+GROUP BY ?res
+
+@@join ?res ?res type=left
+@@values ?res
+PREFIX datacite:
+PREFIX foaf:
+PREFIX literal:
+PREFIX oco:
+PREFIX pro:
+
+SELECT ?res (GROUP_CONCAT(DISTINCT ?agent_info; SEPARATOR="|") AS ?publisher)
+WHERE {
+ ?res pro:isDocumentContextFor ?agent_role.
+ ?agent_role pro:withRole pro:publisher;
+ pro:isHeldBy ?agent.
+ OPTIONAL { ?agent_role oco:hasNext ?next_agent_role }
+ OPTIONAL { ?agent foaf:familyName ?family_name }
+ OPTIONAL { ?agent foaf:givenName ?given_name }
+ OPTIONAL { ?agent foaf:name ?name }
+ OPTIONAL { ?agent datacite:hasIdentifier ?agent_identifier }
+ BIND(COALESCE(?agent_identifier, ) AS ?agent_identifier_node)
+ OPTIONAL { ?agent_identifier_node datacite:usesIdentifierScheme ?agent_scheme }
+ OPTIONAL { ?agent_identifier_node literal:hasLiteralValue ?agent_literal_value }
+ BIND(CONCAT(STRAFTER(STR(?agent_scheme), "http://purl.org/spar/datacite/"), ":", ?agent_literal_value) AS ?agent_id)
+ BIND(CONCAT("omid:ra/", STRAFTER(STR(?agent), "/ra/")) AS ?agent_omid)
BIND(
- IF(BOUND(?venueMetaid),
- IF(STR(?venue_ids) != "",
- CONCAT(" [", ?venue_ids, " ", ?venueMetaid, "]"),
- CONCAT(" [", ?venueMetaid, "]")
- ),
- ""
+ IF(
+ BOUND(?family_name) && BOUND(?given_name),
+ CONCAT(?family_name, ", ", ?given_name),
+ IF(
+ BOUND(?family_name),
+ CONCAT(?family_name, ","),
+ ?name
+ )
)
- AS ?venueIdentifiers)
- BIND(CONCAT(?venueName, ?venueIdentifiers) AS ?venue)
-} GROUP BY ?id ?title ?type ?issue ?volume ?venue ?pub_date ?page
+ AS ?agent_name)
+ BIND(
+ IF(
+ BOUND(?agent_id),
+ CONCAT(?agent_name, " [", ?agent_id, " ", ?agent_omid, "]"),
+ CONCAT(?agent_name, " [", ?agent_omid, "]")
+ )
+ AS ?agent_label)
+ BIND(CONCAT(?agent_label, ":", STRAFTER(STR(?agent_role), "/ar/"), ":", COALESCE(STRAFTER(STR(?next_agent_role), "/ar/"), "")) AS ?agent_info)
+}
+GROUP BY ?res
#url /editor/{id}
#type operation
@@ -658,251 +648,245 @@ The fields returned by this operation are:
"editor": "Allan, Catherine [orcid:0000-0003-2098-4759 omid:ra/069012996]; Stankey, George H. [omid:ra/061808486861]"
}
]
-#sparql PREFIX foaf:
-PREFIX pro:
+#sparql PREFIX datacite:
+PREFIX fabio:
PREFIX literal:
+PREFIX pro:
+
+SELECT DISTINCT ?res
+WHERE {
+ [[id]]
+ ?knownRole pro:withRole pro:editor.
+ ?res pro:isDocumentContextFor ?knownRole;
+ a fabio:Expression.
+}
+LIMIT 1000
+
+@@join ?res ?res type=left
+@@values ?res
PREFIX datacite:
PREFIX dcterm:
-PREFIX frbr:
+PREFIX literal:
+PREFIX prism:
+
+SELECT ?res ?title ?pub_date
+(CONCAT(COALESCE(GROUP_CONCAT(DISTINCT ?external_id; SEPARATOR=""), ""), "omid:br/", STRAFTER(STR(?res), "/br/")) AS ?id)
+WHERE {
+ OPTIONAL { ?res dcterm:title ?title }
+ OPTIONAL { ?res prism:publicationDate ?pub_date }
+ OPTIONAL { ?res datacite:hasIdentifier ?identifier }
+ BIND(COALESCE(?identifier, ) AS ?identifier_node)
+ OPTIONAL { ?identifier_node datacite:usesIdentifierScheme ?scheme }
+ OPTIONAL { ?identifier_node literal:hasLiteralValue ?literal_value }
+ BIND(CONCAT(STRAFTER(STR(?scheme), "http://purl.org/spar/datacite/"), ":", ?literal_value, " ") AS ?external_id)
+}
+GROUP BY ?res ?title ?pub_date
+
+@@join ?res ?res type=left
+@@values ?res
PREFIX fabio:
+
+SELECT DISTINCT ?res ?type
+WHERE {
+ ?res a ?type.
+ FILTER(?type != fabio:Expression)
+}
+
+@@join ?res ?res type=left
+@@values ?res
+PREFIX frbr:
PREFIX prism:
+
+SELECT DISTINCT ?res ?page
+WHERE {
+ ?res frbr:embodiment ?embodiment.
+ ?embodiment prism:startingPage ?starting_page;
+ prism:endingPage ?ending_page.
+ BIND(IF(STR(?starting_page) = STR(?ending_page), STR(?starting_page), CONCAT(?starting_page, "-", ?ending_page)) AS ?page)
+}
+
+@@join ?res ?res type=left
+@@values ?res
+PREFIX fabio:
+PREFIX frbr:
+
+SELECT DISTINCT ?res ?issue
+WHERE {
+ ?res frbr:partOf ?journal_issue.
+ ?journal_issue a fabio:JournalIssue;
+ fabio:hasSequenceIdentifier ?issue.
+}
+
+@@join ?res ?res type=left
+@@values ?res
+PREFIX fabio:
+PREFIX frbr:
+
+SELECT DISTINCT ?res ?volume
+WHERE {
+ ?res frbr:partOf+ ?journal_volume.
+ ?journal_volume a fabio:JournalVolume;
+ fabio:hasSequenceIdentifier ?volume.
+}
+
+@@join ?res ?res type=left
+@@values ?res
+PREFIX datacite:
+PREFIX dcterm:
+PREFIX fabio:
+PREFIX frbr:
+PREFIX literal:
+
+SELECT ?res
+(CONCAT(?venue_name, " [", COALESCE(GROUP_CONCAT(DISTINCT ?venue_external_id; SEPARATOR=""), ""), "omid:br/", STRAFTER(STR(?venue_resource), "/br/"), "]") AS ?venue)
+WHERE {
+ ?res frbr:partOf ?direct_container;
+ frbr:partOf+ ?venue_resource.
+ ?venue_resource dcterm:title ?venue_name.
+ FILTER(?venue_resource = ?direct_container || (EXISTS { ?res a fabio:JournalArticle } && EXISTS { ?venue_resource a fabio:Journal }))
+ OPTIONAL { ?venue_resource datacite:hasIdentifier ?venue_identifier }
+ BIND(COALESCE(?venue_identifier, ) AS ?venue_identifier_node)
+ OPTIONAL { ?venue_identifier_node datacite:usesIdentifierScheme ?venue_scheme }
+ OPTIONAL { ?venue_identifier_node literal:hasLiteralValue ?venue_literal_value }
+ BIND(CONCAT(STRAFTER(STR(?venue_scheme), "http://purl.org/spar/datacite/"), ":", ?venue_literal_value, " ") AS ?venue_external_id)
+}
+GROUP BY ?res ?venue_resource ?venue_name
+
+@@join ?res ?res type=left
+@@values ?res
+PREFIX datacite:
+PREFIX foaf:
+PREFIX literal:
PREFIX oco:
+PREFIX pro:
-SELECT DISTINCT
-?id
-(STR(?title) AS ?title)
-(GROUP_CONCAT(DISTINCT ?author_info; SEPARATOR="|") AS ?author)
-(STR(?pub_date) AS ?pub_date)
-(STR(?issue) AS ?issue)
-(STR(?volume) AS ?volume)
-?venue
-?type
-?page
-(GROUP_CONCAT(DISTINCT ?publisher_info; SEPARATOR="|") AS ?publisher)
-(GROUP_CONCAT(DISTINCT ?combined_editor_info; SEPARATOR="|") AS ?editor)
+SELECT ?res (GROUP_CONCAT(DISTINCT ?agent_info; SEPARATOR="|") AS ?author)
WHERE {
- {
- SELECT ?res ?title ?author_info ?combined_editor_info ?publisher_info ?type ?pub_date ?page ?issue ?volume ?venueName ?venueMetaid
- (GROUP_CONCAT(DISTINCT ?id ; SEPARATOR=" ") AS ?ids)
- (GROUP_CONCAT(DISTINCT ?venue_ids_; SEPARATOR=' ') AS ?venue_ids)
- WHERE {
- {
- SELECT DISTINCT ?res
- WHERE {
- [[id]]
- ?knownRole pro:withRole pro:editor.
- ?res pro:isDocumentContextFor ?knownRole;
- a fabio:Expression.
- } LIMIT 1000
- }
- OPTIONAL {
- ?res datacite:hasIdentifier ?identifier.
- ?identifier datacite:usesIdentifierScheme ?scheme;
- literal:hasLiteralValue ?literalValue.
- BIND(CONCAT(STRAFTER(STR(?scheme), "http://purl.org/spar/datacite/"), ":", ?literalValue) AS ?id)
- }
- OPTIONAL {
- ?res pro:isDocumentContextFor ?arAuthor.
- ?arAuthor pro:withRole pro:author;
- pro:isHeldBy ?raAuthor.
- OPTIONAL {
- ?arAuthor oco:hasNext ?nextAuthorRole .
- }
- BIND(STRAFTER(STR(?arAuthor), "https://w3id.org/oc/meta/ar/") AS ?roleUri)
- BIND(STRAFTER(STR(?nextAuthorRole), "https://w3id.org/oc/meta/ar/") AS ?nextRoleUri)
- BIND(CONCAT("omid:ra/", STRAFTER(STR(?raAuthor), "/ra/")) AS ?author_metaid)
- OPTIONAL {?raAuthor foaf:familyName ?familyName.}
- OPTIONAL {?raAuthor foaf:givenName ?givenName.}
- OPTIONAL {?raAuthor foaf:name ?name.}
- OPTIONAL {
- ?raAuthor datacite:hasIdentifier ?authorIdentifier.
- ?authorIdentifier datacite:usesIdentifierScheme ?authorIdSchema;
- literal:hasLiteralValue ?authorIdLiteralValue.
- BIND(CONCAT(STRAFTER(STR(?authorIdSchema), "http://purl.org/spar/datacite/"), ":", ?authorIdLiteralValue) AS ?author_id)
- }
- BIND(
- IF(
- STRLEN(STR(?familyName)) > 0 && STRLEN(STR(?givenName)) > 0,
- CONCAT(?familyName, ", ", ?givenName),
- IF(
- STRLEN(STR(?familyName)) > 0,
- CONCAT(?familyName, ","),
- ?name
- )
- )
- AS ?authorName)
- BIND(
- IF(
- STRLEN(STR(?author_id)) > 0,
- CONCAT(?authorName, " [", ?author_id, " ", ?author_metaid, "]"),
- CONCAT(?authorName, " [", ?author_metaid, "]")
- )
- AS ?author_)
- BIND(CONCAT(?author_, ":", ?roleUri, ":", COALESCE(?nextRoleUri, "")) AS ?author_info)
- }
- OPTIONAL {
- ?res pro:isDocumentContextFor ?arEditor.
- ?arEditor pro:withRole pro:editor;
- pro:isHeldBy ?raEditor.
- OPTIONAL {
- ?arEditor oco:hasNext ?nextEditorRole .
- }
- BIND(STRAFTER(STR(?arEditor), "https://w3id.org/oc/meta/ar/") AS ?editorRoleUri)
- BIND(STRAFTER(STR(?nextEditorRole), "https://w3id.org/oc/meta/ar/") AS ?nextEditorRoleUri)
- BIND(CONCAT("omid:ra/", STRAFTER(STR(?raEditor), "/ra/")) AS ?editor_metaid)
- OPTIONAL {?raEditor foaf:familyName ?editorFamilyName.}
- OPTIONAL {?raEditor foaf:givenName ?editorGivenName.}
- OPTIONAL {?raEditor foaf:name ?editor_name.}
- OPTIONAL {
- ?raEditor datacite:hasIdentifier ?editorIdentifier.
- ?editorIdentifier datacite:usesIdentifierScheme ?editorIdSchema;
- literal:hasLiteralValue ?editorIdLiteralValue.
- BIND(CONCAT(STRAFTER(STR(?editorIdSchema), "http://purl.org/spar/datacite/"), ":", ?editorIdLiteralValue) AS ?editor_id)
- }
- BIND(
- IF(
- STRLEN(STR(?editorFamilyName)) > 0 && STRLEN(STR(?editorGivenName)) > 0,
- CONCAT(?editorFamilyName, ", ", ?editorGivenName),
- IF(
- STRLEN(STR(?editorFamilyName)) > 0,
- CONCAT(?editorFamilyName, ","),
- ?editor_name
- )
- )
- AS ?editorName)
- BIND(
- IF(
- STRLEN(STR(?editor_id)) > 0,
- CONCAT(?editorName, " [", ?editor_id, " ", ?editor_metaid, "]"),
- CONCAT(?editorName, " [", ?editor_metaid, "]")
- )
- AS ?editor_)
- BIND(CONCAT(?editor_, ":", ?editorRoleUri, ":", COALESCE(?nextEditorRoleUri, "")) AS ?editor_info)
- }
- OPTIONAL {
- ?res frbr:partOf ?container.
- ?container pro:isDocumentContextFor ?arContainerEditor.
- ?arContainerEditor pro:withRole pro:editor;
- pro:isHeldBy ?raContainerEditor.
- OPTIONAL {
- ?arContainerEditor oco:hasNext ?nextContainerEditorRole .
- }
- BIND(STRAFTER(STR(?arContainerEditor), "https://w3id.org/oc/meta/ar/") AS ?containerEditorRoleUri)
- BIND(STRAFTER(STR(?nextContainerEditorRole), "https://w3id.org/oc/meta/ar/") AS ?nextContainerEditorRoleUri)
- BIND(CONCAT("omid:ra/", STRAFTER(STR(?raContainerEditor), "/ra/")) AS ?container_editor_metaid)
- OPTIONAL {?raContainerEditor foaf:familyName ?containerEditorFamilyName.}
- OPTIONAL {?raContainerEditor foaf:givenName ?containerEditorGivenName.}
- OPTIONAL {?raContainerEditor foaf:name ?container_editor_name.}
- OPTIONAL {
- ?raContainerEditor datacite:hasIdentifier ?containerEditorIdentifier.
- ?containerEditorIdentifier datacite:usesIdentifierScheme ?containerEditorIdSchema;
- literal:hasLiteralValue ?containerEditorIdLiteralValue.
- BIND(CONCAT(STRAFTER(STR(?containerEditorIdSchema), "http://purl.org/spar/datacite/"), ":", ?containerEditorIdLiteralValue) AS ?container_editor_id)
- }
- BIND(
- IF(
- STRLEN(STR(?containerEditorFamilyName)) > 0 && STRLEN(STR(?containerEditorGivenName)) > 0,
- CONCAT(?containerEditorFamilyName, ", ", ?containerEditorGivenName),
- IF(
- STRLEN(STR(?containerEditorFamilyName)) > 0,
- CONCAT(?containerEditorFamilyName, ","),
- ?container_editor_name
- )
- )
- AS ?containerEditorName)
- BIND(
- IF(
- STRLEN(STR(?container_editor_id)) > 0,
- CONCAT(?containerEditorName, " [", ?container_editor_id, " ", ?container_editor_metaid, "]"),
- CONCAT(?containerEditorName, " [", ?container_editor_metaid, "]")
- )
- AS ?container_editor_)
- BIND(CONCAT(?container_editor_, ":", ?containerEditorRoleUri, ":", COALESCE(?nextContainerEditorRoleUri, "")) AS ?container_editor_info)
- }
- BIND(
- IF(BOUND(?editor_info),
- IF(BOUND(?container_editor_info),
- CONCAT(?editor_info, "|", ?container_editor_info),
- ?editor_info),
- IF(BOUND(?container_editor_info),
- ?container_editor_info,
- "")
- )
- AS ?combined_editor_info)
- OPTIONAL {
- ?res pro:isDocumentContextFor ?arPublisher.
- ?arPublisher pro:withRole pro:publisher;
- pro:isHeldBy ?raPublisher.
- OPTIONAL {
- ?arPublisher oco:hasNext ?nextPublisherRole .
- }
- BIND(STRAFTER(STR(?arPublisher), "https://w3id.org/oc/meta/ar/") AS ?publisherRoleUri)
- BIND(STRAFTER(STR(?nextPublisherRole), "https://w3id.org/oc/meta/ar/") AS ?nextPublisherRoleUri)
- BIND(CONCAT("omid:ra/", STRAFTER(STR(?raPublisher), "/ra/")) AS ?publisher_metaid)
- ?raPublisher foaf:name ?publisher_name.
- OPTIONAL {
- ?raPublisher datacite:hasIdentifier ?publisherIdentifier__.
- ?publisherIdentifier__ datacite:usesIdentifierScheme ?publisherIdSchema;
- literal:hasLiteralValue ?publisherIdLiteralValue.
- BIND(CONCAT(STRAFTER(STR(?publisherIdSchema), "http://purl.org/spar/datacite/"), ":", ?publisherIdLiteralValue) AS ?publisher_id)
- }
- BIND(
- IF(
- STRLEN(STR(?publisher_id)) > 0,
- CONCAT(?publisher_name, " [", ?publisher_id, " ", ?publisher_metaid, "]"),
- CONCAT(?publisher_name, " [", ?publisher_metaid, "]")
- )
- AS ?publisher_)
- BIND(CONCAT(?publisher_, ":", ?publisherRoleUri, ":", COALESCE(?nextPublisherRoleUri, "")) AS ?publisher_info)
- }
- OPTIONAL {
- {
- ?res a fabio:JournalArticle;
- frbr:partOf+ ?journal.
- BIND(CONCAT("omid:br/", STRAFTER(STR(?journal), "/br/")) AS ?venueMetaid)
- ?journal a fabio:Journal.
- } UNION {
- ?res frbr:partOf ?journal.
- BIND(CONCAT("omid:br/", STRAFTER(STR(?journal), "/br/")) AS ?venueMetaid)
- }
- ?journal dcterm:title ?venueName.
- OPTIONAL {
- ?journal datacite:hasIdentifier ?journalIdentifier__.
- ?journalIdentifier__ datacite:usesIdentifierScheme ?journalIdScheme;
- literal:hasLiteralValue ?journalIdLiteralValue.
- BIND(CONCAT(STRAFTER(STR(?journalIdScheme), "http://purl.org/spar/datacite/"), ":", ?journalIdLiteralValue) AS ?venue_ids_)
- }
- }
- OPTIONAL {?res a ?type. FILTER (?type != fabio:Expression)}
- OPTIONAL {?res dcterm:title ?title.}
- OPTIONAL {?res prism:publicationDate ?pub_date.}
- OPTIONAL {
- ?res frbr:embodiment ?re.
- ?re prism:startingPage ?startingPage;
- prism:endingPage ?endingPage.
- BIND(IF(STR(?startingPage) = STR(?endingPage), STR(?startingPage), CONCAT(?startingPage, '-', ?endingPage)) AS ?page)
- }
- OPTIONAL {
- ?res frbr:partOf ?resIssue.
- ?resIssue a fabio:JournalIssue;
- fabio:hasSequenceIdentifier ?issue.
- }
- OPTIONAL {
- ?res frbr:partOf+ ?resVolume.
- ?resVolume a fabio:JournalVolume;
- fabio:hasSequenceIdentifier ?volume.
- }
- } GROUP BY ?res ?title ?author_info ?combined_editor_info ?publisher_info ?type ?issue ?volume ?pub_date ?page ?venueName ?venueMetaid
- }
- BIND(CONCAT(?ids, IF(STR(?ids) != "", " ", ""), "omid:br/", STRAFTER(STR(?res), "/br/")) AS ?id)
+ ?res pro:isDocumentContextFor ?agent_role.
+ ?agent_role pro:withRole pro:author;
+ pro:isHeldBy ?agent.
+ OPTIONAL { ?agent_role oco:hasNext ?next_agent_role }
+ OPTIONAL { ?agent foaf:familyName ?family_name }
+ OPTIONAL { ?agent foaf:givenName ?given_name }
+ OPTIONAL { ?agent foaf:name ?name }
+ OPTIONAL { ?agent datacite:hasIdentifier ?agent_identifier }
+ BIND(COALESCE(?agent_identifier, ) AS ?agent_identifier_node)
+ OPTIONAL { ?agent_identifier_node datacite:usesIdentifierScheme ?agent_scheme }
+ OPTIONAL { ?agent_identifier_node literal:hasLiteralValue ?agent_literal_value }
+ BIND(CONCAT(STRAFTER(STR(?agent_scheme), "http://purl.org/spar/datacite/"), ":", ?agent_literal_value) AS ?agent_id)
+ BIND(CONCAT("omid:ra/", STRAFTER(STR(?agent), "/ra/")) AS ?agent_omid)
+ BIND(
+ IF(
+ BOUND(?family_name) && BOUND(?given_name),
+ CONCAT(?family_name, ", ", ?given_name),
+ IF(
+ BOUND(?family_name),
+ CONCAT(?family_name, ","),
+ ?name
+ )
+ )
+ AS ?agent_name)
+ BIND(
+ IF(
+ BOUND(?agent_id),
+ CONCAT(?agent_name, " [", ?agent_id, " ", ?agent_omid, "]"),
+ CONCAT(?agent_name, " [", ?agent_omid, "]")
+ )
+ AS ?agent_label)
+ BIND(CONCAT(?agent_label, ":", STRAFTER(STR(?agent_role), "/ar/"), ":", COALESCE(STRAFTER(STR(?next_agent_role), "/ar/"), "")) AS ?agent_info)
+}
+GROUP BY ?res
+
+@@join ?res ?res type=left
+@@values ?res
+PREFIX datacite:
+PREFIX foaf:
+PREFIX frbr:
+PREFIX literal:
+PREFIX oco:
+PREFIX pro:
+
+SELECT ?res (GROUP_CONCAT(DISTINCT ?agent_info; SEPARATOR="|") AS ?editor)
+WHERE {
+ OPTIONAL { ?res frbr:partOf ?container }
+ VALUES ?of_container { false true }
+ BIND(IF(?of_container, COALESCE(?container, ), ?res) AS ?context)
+ ?context pro:isDocumentContextFor ?agent_role.
+ ?agent_role pro:withRole pro:editor;
+ pro:isHeldBy ?agent.
+ OPTIONAL { ?agent_role oco:hasNext ?next_agent_role }
+ OPTIONAL { ?agent foaf:familyName ?family_name }
+ OPTIONAL { ?agent foaf:givenName ?given_name }
+ OPTIONAL { ?agent foaf:name ?name }
+ OPTIONAL { ?agent datacite:hasIdentifier ?agent_identifier }
+ BIND(COALESCE(?agent_identifier, ) AS ?agent_identifier_node)
+ OPTIONAL { ?agent_identifier_node datacite:usesIdentifierScheme ?agent_scheme }
+ OPTIONAL { ?agent_identifier_node literal:hasLiteralValue ?agent_literal_value }
+ BIND(CONCAT(STRAFTER(STR(?agent_scheme), "http://purl.org/spar/datacite/"), ":", ?agent_literal_value) AS ?agent_id)
+ BIND(CONCAT("omid:ra/", STRAFTER(STR(?agent), "/ra/")) AS ?agent_omid)
+ BIND(
+ IF(
+ BOUND(?family_name) && BOUND(?given_name),
+ CONCAT(?family_name, ", ", ?given_name),
+ IF(
+ BOUND(?family_name),
+ CONCAT(?family_name, ","),
+ ?name
+ )
+ )
+ AS ?agent_name)
+ BIND(
+ IF(
+ BOUND(?agent_id),
+ CONCAT(?agent_name, " [", ?agent_id, " ", ?agent_omid, "]"),
+ CONCAT(?agent_name, " [", ?agent_omid, "]")
+ )
+ AS ?agent_label)
+ BIND(CONCAT(?agent_label, ":", STRAFTER(STR(?agent_role), "/ar/"), ":", COALESCE(STRAFTER(STR(?next_agent_role), "/ar/"), "")) AS ?agent_info)
+}
+GROUP BY ?res
+
+@@join ?res ?res type=left
+@@values ?res
+PREFIX datacite:
+PREFIX foaf:
+PREFIX literal:
+PREFIX oco:
+PREFIX pro:
+
+SELECT ?res (GROUP_CONCAT(DISTINCT ?agent_info; SEPARATOR="|") AS ?publisher)
+WHERE {
+ ?res pro:isDocumentContextFor ?agent_role.
+ ?agent_role pro:withRole pro:publisher;
+ pro:isHeldBy ?agent.
+ OPTIONAL { ?agent_role oco:hasNext ?next_agent_role }
+ OPTIONAL { ?agent foaf:familyName ?family_name }
+ OPTIONAL { ?agent foaf:givenName ?given_name }
+ OPTIONAL { ?agent foaf:name ?name }
+ OPTIONAL { ?agent datacite:hasIdentifier ?agent_identifier }
+ BIND(COALESCE(?agent_identifier, ) AS ?agent_identifier_node)
+ OPTIONAL { ?agent_identifier_node datacite:usesIdentifierScheme ?agent_scheme }
+ OPTIONAL { ?agent_identifier_node literal:hasLiteralValue ?agent_literal_value }
+ BIND(CONCAT(STRAFTER(STR(?agent_scheme), "http://purl.org/spar/datacite/"), ":", ?agent_literal_value) AS ?agent_id)
+ BIND(CONCAT("omid:ra/", STRAFTER(STR(?agent), "/ra/")) AS ?agent_omid)
+ BIND(
+ IF(
+ BOUND(?family_name) && BOUND(?given_name),
+ CONCAT(?family_name, ", ", ?given_name),
+ IF(
+ BOUND(?family_name),
+ CONCAT(?family_name, ","),
+ ?name
+ )
+ )
+ AS ?agent_name)
BIND(
- IF(BOUND(?venueMetaid),
- IF(STR(?venue_ids) != "",
- CONCAT(" [", ?venue_ids, " ", ?venueMetaid, "]"),
- CONCAT(" [", ?venueMetaid, "]")
- ),
- ""
+ IF(
+ BOUND(?agent_id),
+ CONCAT(?agent_name, " [", ?agent_id, " ", ?agent_omid, "]"),
+ CONCAT(?agent_name, " [", ?agent_omid, "]")
)
- AS ?venueIdentifiers)
- BIND(CONCAT(?venueName, ?venueIdentifiers) AS ?venue)
-} GROUP BY ?id ?title ?type ?issue ?volume ?venue ?pub_date ?page
+ AS ?agent_label)
+ BIND(CONCAT(?agent_label, ":", STRAFTER(STR(?agent_role), "/ar/"), ":", COALESCE(STRAFTER(STR(?next_agent_role), "/ar/"), "")) AS ?agent_info)
+}
+GROUP BY ?res
diff --git a/src/api/metaapi.py b/src/api/metaapi.py
index 3f1d1d9..20ccca5 100644
--- a/src/api/metaapi.py
+++ b/src/api/metaapi.py
@@ -85,18 +85,10 @@ def generate_id_search(ids: str) -> Tuple[str]:
other_values.append(
'''
{{
- {
- ?identifier literal:hasLiteralValue "'''
+ ?identifier literal:hasLiteralValue "'''
+ literal_value
- + '''"
- }
- UNION
- {
- ?identifier literal:hasLiteralValue "'''
- + literal_value
- + """"^^
- }
- ?identifier datacite:usesIdentifierScheme datacite:"""
+ + """";
+ datacite:usesIdentifierScheme datacite:"""
+ scheme
+ """;
^datacite:hasIdentifier ?res.
@@ -132,21 +124,13 @@ def generate_ra_search(identifier: str) -> Tuple[str]:
else:
return (
'''
- {
- ?knownPersonIdentifier literal:hasLiteralValue "'''
- + literal_value
- + '''"
- }
- UNION
- {
- ?knownPersonIdentifier literal:hasLiteralValue "'''
+ ?knownPersonIdentifier literal:hasLiteralValue "'''
+ literal_value
- + """"^^
- }
- ?knownPersonIdentifier datacite:usesIdentifierScheme datacite:"""
+ + """";
+ datacite:usesIdentifierScheme datacite:"""
+ scheme
+ """;
- ^datacite:hasIdentifier ?knownPerson.
+ ^datacite:hasIdentifier ?knownPerson.
?knownPerson ^pro:isHeldBy ?knownRole.
""",
)
@@ -158,7 +142,13 @@ def create_metadata_output(results):
for result in results[1:]:
output_result = list()
for i, data in enumerate(result):
- if i == header.index("type"):
+ if i == header.index("id"):
+ sorted_ids = __sort_ids(data[1])
+ output_result.append((sorted_ids, sorted_ids))
+ elif i == header.index("venue"):
+ sorted_venue = __sort_venue_ids(data[1])
+ output_result.append((sorted_venue, sorted_venue))
+ elif i == header.index("type"):
beautiful_type = __postprocess_type(data[1])
output_result.append((data[0], beautiful_type))
elif (
@@ -174,6 +164,18 @@ def create_metadata_output(results):
return output_results, True
+def __sort_ids(ids: str) -> str:
+ *external_ids, omid = ids.split(" ")
+ return " ".join(sorted(external_ids) + [omid])
+
+
+def __sort_venue_ids(venue: str) -> str:
+ if not venue:
+ return venue
+ name, ids = venue.rsplit(" [", 1)
+ return f"{name} [{__sort_ids(ids.removesuffix(']'))}]"
+
+
def __postprocess_type(type_uri: str) -> str:
if type_uri:
type_string = URI_TYPE_DICT[type_uri]
diff --git a/src/api/skgif_filters.ocdm.yaml b/src/api/skgif_filters.ocdm.yaml
index 6f2f32b..0a70494 100644
--- a/src/api/skgif_filters.ocdm.yaml
+++ b/src/api/skgif_filters.ocdm.yaml
@@ -3,13 +3,7 @@
# SPDX-License-Identifier: CC0-1.0
identifiers.id:
- filter: |-
- ?local_identifier datacite:hasIdentifier ?_filter_identifier .
- {
- ?_filter_identifier literal:hasLiteralValue "{{value}}" .
- } UNION {
- ?_filter_identifier literal:hasLiteralValue "{{value}}"^^ .
- }
+ filter: '?local_identifier datacite:hasIdentifier [ literal:hasLiteralValue "{{value}}"^^ ] .'
identifiers.scheme:
filter: "?local_identifier datacite:hasIdentifier [ datacite:usesIdentifierScheme datacite:{{value}} ] ."
contributions.by.local_identifier:
@@ -17,7 +11,7 @@ contributions.by.local_identifier:
cf.search.title:
filter: |-
?local_identifier dcterm:title ?title .
- ?title bif:contains "'{{value}}'" .
+ { SELECT DISTINCT ?title WHERE { ?title ?_word . FILTER STRSTARTS(?_word, "{{value}}") } }
contributions.by.family_name:
filter: |-
?local_identifier pro:isDocumentContextFor [ pro:isHeldBy ?_filter_agent ] .
@@ -33,12 +27,7 @@ contributions.by.name:
contributions.by.identifiers.id:
filter: |-
?local_identifier pro:isDocumentContextFor [ pro:isHeldBy ?_filter_agent ] .
- ?_filter_agent datacite:hasIdentifier ?_filter_agent_identifier .
- {
- ?_filter_agent_identifier literal:hasLiteralValue "{{value}}" .
- } UNION {
- ?_filter_agent_identifier literal:hasLiteralValue "{{value}}"^^ .
- }
+ ?_filter_agent datacite:hasIdentifier [ literal:hasLiteralValue "{{value}}"^^ ] .
contributions.by.identifiers.scheme:
filter: |-
?local_identifier pro:isDocumentContextFor [ pro:isHeldBy ?_filter_agent ] .
@@ -46,13 +35,7 @@ contributions.by.identifiers.scheme:
cf.contributions_orcid:
filter: |-
?local_identifier pro:isDocumentContextFor [ pro:isHeldBy ?_filter_agent ] .
- ?_filter_agent datacite:hasIdentifier ?_filter_agent_identifier .
- ?_filter_agent_identifier datacite:usesIdentifierScheme datacite:orcid .
- {
- ?_filter_agent_identifier literal:hasLiteralValue "{{value}}" .
- } UNION {
- ?_filter_agent_identifier literal:hasLiteralValue "{{value}}"^^ .
- }
+ ?_filter_agent datacite:hasIdentifier [ literal:hasLiteralValue "{{value}}"^^ ; datacite:usesIdentifierScheme datacite:orcid ] .
product_type:
filter:
literature: |-
@@ -88,14 +71,9 @@ cf.cites_doi:
filter_preamble: |-
PREFIX datacite:
PREFIX literal:
- SELECT DISTINCT ?_target WHERE {
+ SELECT ?_target WHERE {
?_target datacite:hasIdentifier ?_id_node .
- ?_id_node datacite:usesIdentifierScheme datacite:doi .
- {
- ?_id_node literal:hasLiteralValue "{{value}}" .
- } UNION {
- ?_id_node literal:hasLiteralValue "{{value}}"^^ .
- }
+ ?_id_node datacite:usesIdentifierScheme datacite:doi ; literal:hasLiteralValue "{{value}}"^^ .
}
@@values ?_target
@@join ?_target ?_target type=inner
@@ -111,14 +89,9 @@ cf.cited_by_doi:
filter_preamble: |-
PREFIX datacite:
PREFIX literal:
- SELECT DISTINCT ?_target WHERE {
+ SELECT ?_target WHERE {
?_target datacite:hasIdentifier ?_id_node .
- ?_id_node datacite:usesIdentifierScheme datacite:doi .
- {
- ?_id_node literal:hasLiteralValue "{{value}}" .
- } UNION {
- ?_id_node literal:hasLiteralValue "{{value}}"^^ .
- }
+ ?_id_node datacite:usesIdentifierScheme datacite:doi ; literal:hasLiteralValue "{{value}}"^^ .
}
@@values ?_target
@@join ?_target ?_target type=inner
diff --git a/src/api/skgif_filters.organisations.yaml b/src/api/skgif_filters.organisations.yaml
index 01af5e9..7ba16ee 100644
--- a/src/api/skgif_filters.organisations.yaml
+++ b/src/api/skgif_filters.organisations.yaml
@@ -10,5 +10,4 @@ name:
filter: "?local_identifier foaf:name '{{value}}'. "
cf.search.name:
filter: |-
- ?local_identifier foaf:name ?name .
- ?name bif:contains "'{{value}}'" .
+ { SELECT DISTINCT ?name WHERE { ?name ?_word . FILTER STRSTARTS(?_word, "{{value}}") } }
diff --git a/src/api/skgif_filters.persons.yaml b/src/api/skgif_filters.persons.yaml
index 199a8a5..99a252d 100644
--- a/src/api/skgif_filters.persons.yaml
+++ b/src/api/skgif_filters.persons.yaml
@@ -15,12 +15,12 @@ name:
cf.search.family_name:
filter: |-
?local_identifier foaf:familyName ?familyName .
- ?familyName bif:contains "'{{value}}'" .
+ { SELECT DISTINCT ?familyName WHERE { ?familyName ?_word . FILTER STRSTARTS(?_word, "{{value}}") } }
cf.search.given_name:
filter: |-
?local_identifier foaf:givenName ?givenName .
- ?givenName bif:contains "'{{value}}'" .
+ { SELECT DISTINCT ?givenName WHERE { ?givenName ?_word . FILTER STRSTARTS(?_word, "{{value}}") } }
cf.search.name:
filter: |-
?local_identifier foaf:name ?name .
- ?name bif:contains "'{{value}}'" .
+ { SELECT DISTINCT ?name WHERE { ?name ?_word . FILTER STRSTARTS(?_word, "{{value}}") } }
diff --git a/src/api/skgif_filters.venues.yaml b/src/api/skgif_filters.venues.yaml
index 470e05d..0898452 100644
--- a/src/api/skgif_filters.venues.yaml
+++ b/src/api/skgif_filters.venues.yaml
@@ -5,14 +5,16 @@
type:
filter:
journal: |-
- FILTER(?type = "journal")
+ ?local_identifier a fabio:Journal .
conference: |-
- FILTER(?type = "conference")
+ ?local_identifier a fabio:AcademicProceedings .
book: |-
- FILTER(?type = "book")
+ VALUES ?_book_type { fabio:Book fabio:ReferenceBook }
+ ?local_identifier a ?_book_type .
repository: "FILTER(false)"
other: |-
- FILTER(?type = "other")
+ ?local_identifier a ?_other_type .
+ FILTER(?_other_type NOT IN (fabio:Expression, fabio:Journal, fabio:AcademicProceedings, fabio:Book, fabio:ReferenceBook))
unknown: "FILTER(false)"
identifiers.value:
filter: '?local_identifier datacite:hasIdentifier [ literal:hasLiteralValue "{{value}}"^^ ] .'
@@ -23,4 +25,4 @@ name:
cf.search.name:
filter: |-
?local_identifier dcterms:title ?name .
- ?name bif:contains "'{{value}}'" .
+ { SELECT DISTINCT ?name WHERE { ?name ?_word . FILTER STRSTARTS(?_word, "{{value}}") } }
diff --git a/src/api/skgif_v1.hf b/src/api/skgif_v1.hf
index c4e94a0..c2463b7 100644
--- a/src/api/skgif_v1.hf
+++ b/src/api/skgif_v1.hf
@@ -7,9 +7,9 @@
#version 1.0.0
#contacts [contact@opencitations.net](mailto:contact@opencitations.net)
#license [ISC](https://opensource.org/licenses/ISC)
-#endpoint http://virtuoso-service.default.svc.cluster.local:8890/sparql
+#endpoint http://meta-qlever-service.default.svc.cluster.local:7011
#method post
-#sources meta=http://virtuoso-service.default.svc.cluster.local:8890/sparql;index=http://qlever-service.default.svc.cluster.local:7011
+#sources meta=http://meta-qlever-service.default.svc.cluster.local:7011;index=http://qlever-service.default.svc.cluster.local:7011
#addon ramose.skg_if
#disable_params require,filter,sort,format,json
@@ -165,13 +165,13 @@
"entity_type": "venue",
"local_identifier": "venues/br/062501778099",
"identifiers": [
- {
- "value": "S4210195326",
- "scheme": "openalex"
- },
{
"value": "2641-3337",
"scheme": "issn"
+ },
+ {
+ "value": "S4210195326",
+ "scheme": "openalex"
}
]
}
@@ -240,107 +240,172 @@
#sparql PREFIX fabio:
PREFIX dcterm:
PREFIX prism:
-PREFIX frbr:
-PREFIX datacite:
-PREFIX literal:
-SELECT ?local_identifier ?identifier_scheme ?identifier_value
- ?title ?product_type
- ?manifestation_type_class ?manifestation_type_label ?manifestation_type_label_lang
- ?manifestation_type_defined_in
- ?manifestation_dates_type ?manifestation_dates_value
- ?manifestation_biblio_volume ?manifestation_biblio_issue
- ?manifestation_biblio_pages_first ?manifestation_biblio_pages_last
- ?manifestation_biblio_in_name ?manifestation_biblio_in_local_identifier
- ?manifestation_biblio_in_identifier_scheme ?manifestation_biblio_in_identifier_value
+SELECT ?local_identifier ?title ?product_type
+ ?manifestation_dates_type ?manifestation_dates_value ?manifestation_type_class
+ ?manifestation_type_label ?manifestation_type_label_lang ?manifestation_type_defined_in
+ ?manifestation_biblio_pages_first ?manifestation_biblio_pages_last ?manifestation_biblio_issue
+ ?manifestation_biblio_volume ?identifier_scheme ?identifier_value
+ ?manifestation_biblio_in_name ?manifestation_biblio_in_local_identifier ?manifestation_biblio_in_identifier_scheme
+ ?manifestation_biblio_in_identifier_value ?contribution_by_family_name ?contribution_by_given_name
+ ?contribution_by_name ?contribution_by_local_identifier ?contribution_role
+ ?_contribution_key ?_contribution_next_key ?contribution_by_identifier_scheme
+ ?contribution_by_identifier_value
WHERE {
- BIND(<[[local_identifier]]> AS ?local_identifier)
+ VALUES ?local_identifier { <[[local_identifier]]> }
?local_identifier a fabio:Expression .
OPTIONAL { ?local_identifier dcterm:title ?title }
- OPTIONAL { ?local_identifier a ?manifestation_type_class . FILTER(?manifestation_type_class != fabio:Expression) }
- BIND(IF(!BOUND(?manifestation_type_class), "literature", IF(?manifestation_type_class IN (, ), "research data", IF(?manifestation_type_class = , "research software", "literature"))) AS ?product_type)
- BIND(IF(BOUND(?manifestation_type_class), LCASE(REPLACE(REPLACE(STR(?manifestation_type_class), "^.*[/#]", ""), "([a-z])([A-Z])", "$1 $2")), "") AS ?manifestation_type_label)
- BIND(IF(BOUND(?manifestation_type_class), "en", "") AS ?manifestation_type_label_lang)
- BIND(IF(BOUND(?manifestation_type_class), REPLACE(STR(?manifestation_type_class), "[/#][^/#]+$", ""), "") AS ?manifestation_type_defined_in)
+ OPTIONAL { ?local_identifier prism:publicationDate ?manifestation_dates_value }
+ BIND(IF(BOUND(?manifestation_dates_value), "publication", ?_unbound) AS ?manifestation_dates_type)
OPTIONAL {
- ?local_identifier prism:publicationDate ?manifestation_dates_value .
- BIND("publication" AS ?manifestation_dates_type)
- }
- OPTIONAL {
- ?local_identifier frbr:embodiment ?resource_embodiment .
- ?resource_embodiment prism:startingPage ?manifestation_biblio_pages_first ;
- prism:endingPage ?manifestation_biblio_pages_last .
- }
- OPTIONAL {
- ?local_identifier frbr:partOf ?journal_issue .
- ?journal_issue a fabio:JournalIssue ;
- fabio:hasSequenceIdentifier ?manifestation_biblio_issue .
- }
- OPTIONAL {
- ?local_identifier frbr:partOf+ ?journal_volume .
- ?journal_volume a fabio:JournalVolume ;
- fabio:hasSequenceIdentifier ?manifestation_biblio_volume .
- }
- OPTIONAL {
- ?local_identifier datacite:hasIdentifier ?identifier_node .
- ?identifier_node datacite:usesIdentifierScheme ?identifier_scheme_uri ;
- literal:hasLiteralValue ?identifier_value .
- BIND(STRAFTER(STR(?identifier_scheme_uri), "http://purl.org/spar/datacite/") AS ?identifier_scheme)
- }
- OPTIONAL {
- {
- ?local_identifier a fabio:JournalArticle ;
- frbr:partOf+ ?venue_resource .
- ?venue_resource a fabio:Journal .
- } UNION {
- ?local_identifier frbr:partOf ?venue_resource .
- FILTER NOT EXISTS { ?venue_resource a fabio:JournalIssue }
- FILTER NOT EXISTS { ?venue_resource a fabio:JournalVolume }
- }
- ?venue_resource dcterm:title ?manifestation_biblio_in_name .
- BIND(STR(?venue_resource) AS ?manifestation_biblio_in_local_identifier)
- OPTIONAL {
- ?venue_resource datacite:hasIdentifier ?venue_identifier_node .
- ?venue_identifier_node datacite:usesIdentifierScheme ?venue_identifier_scheme_uri ;
- literal:hasLiteralValue ?manifestation_biblio_in_identifier_value .
- BIND(STRAFTER(STR(?venue_identifier_scheme_uri), "http://purl.org/spar/datacite/") AS ?manifestation_biblio_in_identifier_scheme)
- }
+ VALUES ?_special_type { fabio:DataFile fabio:DataManagementPlan fabio:ComputerProgram }
+ ?local_identifier a ?_special_type .
}
+ BIND(IF(!BOUND(?_special_type), "literature", IF(?_special_type = fabio:ComputerProgram, "research software", "research data")) AS ?product_type)
}
+ORDER BY ?local_identifier
@@join ?local_identifier ?local_identifier type=left
-PREFIX pro:
-PREFIX foaf:
+PREFIX fabio:
+
+SELECT ?local_identifier ?manifestation_type_class ?manifestation_type_label ?manifestation_type_label_lang ?manifestation_type_defined_in
+WHERE {
+ VALUES ?local_identifier { <[[local_identifier]]> }
+ ?local_identifier a ?manifestation_type_class .
+ FILTER(?manifestation_type_class != fabio:Expression)
+ BIND(LCASE(REPLACE(REPLACE(STR(?manifestation_type_class), "^.*[/#]", ""), "([a-z])([A-Z])", "$1 $2")) AS ?manifestation_type_label)
+ BIND("en" AS ?manifestation_type_label_lang)
+ BIND(REPLACE(STR(?manifestation_type_class), "[/#][^/#]+$", "") AS ?manifestation_type_defined_in)
+}
+ORDER BY ?local_identifier ?manifestation_type_class
+
+@@join ?local_identifier ?local_identifier type=left
+PREFIX prism:
+PREFIX frbr:
+
+SELECT ?local_identifier ?manifestation_biblio_pages_first ?manifestation_biblio_pages_last
+WHERE {
+ VALUES ?local_identifier { <[[local_identifier]]> }
+ ?local_identifier frbr:embodiment ?resource_embodiment .
+ ?resource_embodiment prism:startingPage ?manifestation_biblio_pages_first ;
+ prism:endingPage ?manifestation_biblio_pages_last .
+}
+
+@@join ?local_identifier ?local_identifier type=left
+PREFIX fabio:
+PREFIX frbr:
+
+SELECT ?local_identifier ?manifestation_biblio_issue
+WHERE {
+ VALUES ?local_identifier { <[[local_identifier]]> }
+ ?local_identifier frbr:partOf ?journal_issue .
+ ?journal_issue a fabio:JournalIssue ;
+ fabio:hasSequenceIdentifier ?manifestation_biblio_issue .
+}
+
+@@join ?local_identifier ?local_identifier type=left
+PREFIX fabio:
+PREFIX frbr:
+
+SELECT ?local_identifier ?manifestation_biblio_volume
+WHERE {
+ VALUES ?local_identifier { <[[local_identifier]]> }
+ ?local_identifier frbr:partOf+ ?journal_volume .
+ ?journal_volume a fabio:JournalVolume ;
+ fabio:hasSequenceIdentifier ?manifestation_biblio_volume .
+}
+
+@@join ?local_identifier ?local_identifier type=left
+PREFIX datacite:
+PREFIX literal:
+
+SELECT ?local_identifier ?identifier_scheme ?identifier_value
+WHERE {
+ VALUES ?local_identifier { <[[local_identifier]]> }
+ ?local_identifier datacite:hasIdentifier ?identifier_node .
+ ?identifier_node datacite:usesIdentifierScheme ?identifier_scheme_uri ;
+ literal:hasLiteralValue ?identifier_value .
+ BIND(STRAFTER(STR(?identifier_scheme_uri), "http://purl.org/spar/datacite/") AS ?identifier_scheme)
+}
+ORDER BY ?local_identifier ?identifier_scheme ?identifier_value
+
+@@join ?local_identifier ?local_identifier type=left
+PREFIX fabio:
+PREFIX dcterm:
+PREFIX frbr:
+
+SELECT DISTINCT ?local_identifier ?manifestation_biblio_in_name ?manifestation_biblio_in_local_identifier
+WHERE {
+ VALUES ?local_identifier { <[[local_identifier]]> }
+ ?local_identifier frbr:partOf ?direct_container ;
+ frbr:partOf+ ?venue_resource .
+ ?venue_resource dcterm:title ?manifestation_biblio_in_name .
+ FILTER(
+ (?venue_resource = ?direct_container
+ && NOT EXISTS { ?venue_resource a fabio:JournalIssue }
+ && NOT EXISTS { ?venue_resource a fabio:JournalVolume })
+ || (EXISTS { ?local_identifier a fabio:JournalArticle } && EXISTS { ?venue_resource a fabio:Journal })
+ )
+ BIND(STR(?venue_resource) AS ?manifestation_biblio_in_local_identifier)
+}
+ORDER BY ?local_identifier ?manifestation_biblio_in_local_identifier
+
+@@join ?manifestation_biblio_in_local_identifier ?manifestation_biblio_in_local_identifier type=left
+PREFIX frbr:
PREFIX datacite:
PREFIX literal:
+
+SELECT DISTINCT ?manifestation_biblio_in_local_identifier ?manifestation_biblio_in_identifier_scheme ?manifestation_biblio_in_identifier_value
+WHERE {
+ VALUES ?local_identifier { <[[local_identifier]]> }
+ ?local_identifier frbr:partOf+ ?venue_resource .
+ ?venue_resource datacite:hasIdentifier ?venue_identifier_node .
+ ?venue_identifier_node datacite:usesIdentifierScheme ?venue_identifier_scheme_uri ;
+ literal:hasLiteralValue ?manifestation_biblio_in_identifier_value .
+ BIND(STRAFTER(STR(?venue_identifier_scheme_uri), "http://purl.org/spar/datacite/") AS ?manifestation_biblio_in_identifier_scheme)
+ BIND(STR(?venue_resource) AS ?manifestation_biblio_in_local_identifier)
+}
+ORDER BY ?manifestation_biblio_in_local_identifier ?manifestation_biblio_in_identifier_scheme ?manifestation_biblio_in_identifier_value
+
+@@join ?local_identifier ?local_identifier type=left
+PREFIX pro:
+PREFIX foaf:
PREFIX oco:
SELECT ?local_identifier ?contribution_by_family_name ?contribution_by_given_name
- ?contribution_by_name ?contribution_by_identifier_scheme ?contribution_by_identifier_value
- ?contribution_by_local_identifier
+ ?contribution_by_name ?contribution_by_local_identifier
?contribution_role ?_contribution_key ?_contribution_next_key
WHERE {
- BIND(<[[local_identifier]]> AS ?local_identifier)
+ VALUES ?local_identifier { <[[local_identifier]]> }
?local_identifier pro:isDocumentContextFor ?agent_role .
?agent_role pro:withRole ?role_type ;
pro:isHeldBy ?responsible_agent .
- FILTER(?role_type IN (pro:author, pro:editor, pro:publisher))
- BIND(IF(?role_type = pro:author, "author", IF(?role_type = pro:editor, "editor", "publisher")) AS ?contribution_role)
+ BIND(IF(?role_type = pro:author, "author", IF(?role_type = pro:editor, "editor", IF(?role_type = pro:publisher, "publisher", ?_unbound))) AS ?contribution_role)
+ FILTER(BOUND(?contribution_role))
BIND(STR(?agent_role) AS ?_contribution_key)
- OPTIONAL {
- ?agent_role oco:hasNext ?next_agent_role .
- BIND(STR(?next_agent_role) AS ?_contribution_next_key)
- }
+ OPTIONAL { ?agent_role oco:hasNext ?next_agent_role }
+ BIND(STR(?next_agent_role) AS ?_contribution_next_key)
OPTIONAL { ?responsible_agent foaf:familyName ?contribution_by_family_name }
OPTIONAL { ?responsible_agent foaf:givenName ?contribution_by_given_name }
OPTIONAL { ?responsible_agent foaf:name ?contribution_by_name }
BIND(STR(?responsible_agent) AS ?contribution_by_local_identifier)
- OPTIONAL {
- ?responsible_agent datacite:hasIdentifier ?orcid_node .
- ?orcid_node datacite:usesIdentifierScheme datacite:orcid ;
- literal:hasLiteralValue ?contribution_by_identifier_value .
- BIND("orcid" AS ?contribution_by_identifier_scheme)
- }
+}
+
+@@join ?contribution_by_local_identifier ?contribution_by_local_identifier type=left
+PREFIX datacite:
+PREFIX literal:
+PREFIX pro:
+
+SELECT DISTINCT ?contribution_by_local_identifier ?contribution_by_identifier_scheme ?contribution_by_identifier_value
+WHERE {
+ VALUES ?local_identifier { <[[local_identifier]]> }
+ ?local_identifier pro:isDocumentContextFor ?agent_role .
+ ?agent_role pro:isHeldBy ?responsible_agent .
+ ?responsible_agent datacite:hasIdentifier ?orcid_node .
+ ?orcid_node datacite:usesIdentifierScheme datacite:orcid ;
+ literal:hasLiteralValue ?contribution_by_identifier_value .
+ BIND("orcid" AS ?contribution_by_identifier_scheme)
+ BIND(STR(?responsible_agent) AS ?contribution_by_local_identifier)
}
@@join ?local_identifier ?local_identifier type=left
@@ -420,13 +485,13 @@ Filters in the first group use exact matching. For `cf.search.*`, matching is te
]
},
"identifiers": [
- {
- "value": "W4285173206",
- "scheme": "openalex"
- },
{
"value": "10.1007/978-3-031-06981-9_18",
"scheme": "doi"
+ },
+ {
+ "value": "W4285173206",
+ "scheme": "openalex"
}
],
"contributions": [
@@ -684,13 +749,13 @@ Filters in the first group use exact matching. For `cf.search.*`, matching is te
]
},
"identifiers": [
- {
- "value": "W3106215946",
- "scheme": "openalex"
- },
{
"value": "10.1162/qss_a_00023",
"scheme": "doi"
+ },
+ {
+ "value": "W3106215946",
+ "scheme": "openalex"
}
],
"contributions": [
@@ -764,13 +829,13 @@ Filters in the first group use exact matching. For `cf.search.*`, matching is te
"entity_type": "venue",
"local_identifier": "https://w3id.org/oc/meta/br/062501778099",
"identifiers": [
- {
- "value": "S4210195326",
- "scheme": "openalex"
- },
{
"value": "2641-3337",
"scheme": "issn"
+ },
+ {
+ "value": "S4210195326",
+ "scheme": "openalex"
}
]
}
@@ -788,13 +853,13 @@ Filters in the first group use exact matching. For `cf.search.*`, matching is te
]
},
"identifiers": [
- {
- "value": "W2938946739",
- "scheme": "openalex"
- },
{
"value": "10.1007/s11192-019-03217-6",
"scheme": "doi"
+ },
+ {
+ "value": "W2938946739",
+ "scheme": "openalex"
}
],
"contributions": [
@@ -886,16 +951,16 @@ Filters in the first group use exact matching. For `cf.search.*`, matching is te
"local_identifier": "https://w3id.org/oc/meta/br/0626055628",
"identifiers": [
{
- "value": "S148561398",
- "scheme": "openalex"
+ "value": "0138-9130",
+ "scheme": "issn"
},
{
"value": "1588-2861",
"scheme": "issn"
},
{
- "value": "0138-9130",
- "scheme": "issn"
+ "value": "S148561398",
+ "scheme": "openalex"
}
]
}
@@ -1181,11 +1246,11 @@ Filters in the first group use exact matching. For `cf.search.*`, matching is te
"local_identifier": "https://w3id.org/oc/meta/br/0626055628",
"identifiers": [
{
- "value": "1588-2861",
+ "value": "0138-9130",
"scheme": "issn"
},
{
- "value": "0138-9130",
+ "value": "1588-2861",
"scheme": "issn"
},
{
@@ -1286,16 +1351,16 @@ Filters in the first group use exact matching. For `cf.search.*`, matching is te
"local_identifier": "https://w3id.org/oc/meta/br/06160781188",
"identifiers": [
{
- "value": "S110615584",
- "scheme": "openalex"
+ "value": "1432-1300",
+ "scheme": "issn"
},
{
"value": "1432-5012",
"scheme": "issn"
},
{
- "value": "1432-1300",
- "scheme": "issn"
+ "value": "S110615584",
+ "scheme": "openalex"
}
]
}
@@ -1331,109 +1396,180 @@ ORDER BY ?local_identifier
PREFIX fabio:
PREFIX dcterm:
PREFIX prism:
-PREFIX frbr:
-PREFIX datacite:
-PREFIX literal:
-PREFIX pro:
-PREFIX foaf:
-SELECT ?local_identifier ?identifier_scheme ?identifier_value
- ?title ?product_type
- ?manifestation_type_class ?manifestation_type_label ?manifestation_type_label_lang
- ?manifestation_type_defined_in
- ?manifestation_dates_type ?manifestation_dates_value
- ?manifestation_biblio_volume ?manifestation_biblio_issue
- ?manifestation_biblio_pages_first ?manifestation_biblio_pages_last
- ?manifestation_biblio_in_name ?manifestation_biblio_in_local_identifier
- ?manifestation_biblio_in_identifier_scheme ?manifestation_biblio_in_identifier_value
+SELECT ?local_identifier ?title ?product_type
+ ?manifestation_dates_type ?manifestation_dates_value ?manifestation_type_class
+ ?manifestation_type_label ?manifestation_type_label_lang ?manifestation_type_defined_in
+ ?manifestation_biblio_pages_first ?manifestation_biblio_pages_last ?manifestation_biblio_issue
+ ?manifestation_biblio_volume ?identifier_scheme ?identifier_value
+ ?manifestation_biblio_in_name ?manifestation_biblio_in_local_identifier ?manifestation_biblio_in_identifier_scheme
+ ?manifestation_biblio_in_identifier_value ?contribution_by_family_name ?contribution_by_given_name
+ ?contribution_by_name ?contribution_by_local_identifier ?contribution_role
+ ?_contribution_key ?_contribution_next_key ?contribution_by_identifier_scheme
+ ?contribution_by_identifier_value
WHERE {
?local_identifier a fabio:Expression .
- OPTIONAL { ?local_identifier dcterm:title ?title . }
- OPTIONAL { ?local_identifier a ?manifestation_type_class . FILTER(?manifestation_type_class != fabio:Expression) }
- BIND(IF(!BOUND(?manifestation_type_class), "literature", IF(?manifestation_type_class IN (, ), "research data", IF(?manifestation_type_class = , "research software", "literature"))) AS ?product_type)
- BIND(IF(BOUND(?manifestation_type_class), LCASE(REPLACE(REPLACE(STR(?manifestation_type_class), "^.*[/#]", ""), "([a-z])([A-Z])", "$1 $2")), "") AS ?manifestation_type_label)
- BIND(IF(BOUND(?manifestation_type_class), "en", "") AS ?manifestation_type_label_lang)
- BIND(IF(BOUND(?manifestation_type_class), REPLACE(STR(?manifestation_type_class), "[/#][^/#]+$", ""), "") AS ?manifestation_type_defined_in)
- OPTIONAL {
- ?local_identifier prism:publicationDate ?manifestation_dates_value .
- BIND("publication" AS ?manifestation_dates_type)
- }
- OPTIONAL {
- ?local_identifier frbr:embodiment ?resource_embodiment .
- ?resource_embodiment prism:startingPage ?manifestation_biblio_pages_first ;
- prism:endingPage ?manifestation_biblio_pages_last .
- }
- OPTIONAL {
- ?local_identifier frbr:partOf ?journal_issue .
- ?journal_issue a fabio:JournalIssue ;
- fabio:hasSequenceIdentifier ?manifestation_biblio_issue .
- }
- OPTIONAL {
- ?local_identifier frbr:partOf+ ?journal_volume .
- ?journal_volume a fabio:JournalVolume ;
- fabio:hasSequenceIdentifier ?manifestation_biblio_volume .
- }
- OPTIONAL {
- ?local_identifier datacite:hasIdentifier ?identifier_node .
- ?identifier_node datacite:usesIdentifierScheme ?identifier_scheme_uri ;
- literal:hasLiteralValue ?identifier_value .
- BIND(STRAFTER(STR(?identifier_scheme_uri), "http://purl.org/spar/datacite/") AS ?identifier_scheme)
- }
+ OPTIONAL { ?local_identifier dcterm:title ?title }
+ OPTIONAL { ?local_identifier prism:publicationDate ?manifestation_dates_value }
+ BIND(IF(BOUND(?manifestation_dates_value), "publication", ?_unbound) AS ?manifestation_dates_type)
OPTIONAL {
- {
- ?local_identifier a fabio:JournalArticle ;
- frbr:partOf+ ?venue_resource .
- ?venue_resource a fabio:Journal .
- } UNION {
- ?local_identifier frbr:partOf ?venue_resource .
- FILTER NOT EXISTS { ?venue_resource a fabio:JournalIssue }
- FILTER NOT EXISTS { ?venue_resource a fabio:JournalVolume }
- }
- ?venue_resource dcterm:title ?manifestation_biblio_in_name .
- BIND(STR(?venue_resource) AS ?manifestation_biblio_in_local_identifier)
- OPTIONAL {
- ?venue_resource datacite:hasIdentifier ?venue_identifier_node .
- ?venue_identifier_node datacite:usesIdentifierScheme ?venue_identifier_scheme_uri ;
- literal:hasLiteralValue ?manifestation_biblio_in_identifier_value .
- BIND(STRAFTER(STR(?venue_identifier_scheme_uri), "http://purl.org/spar/datacite/") AS ?manifestation_biblio_in_identifier_scheme)
- }
+ VALUES ?_special_type { fabio:DataFile fabio:DataManagementPlan fabio:ComputerProgram }
+ ?local_identifier a ?_special_type .
}
+ BIND(IF(!BOUND(?_special_type), "literature", IF(?_special_type = fabio:ComputerProgram, "research software", "research data")) AS ?product_type)
}
ORDER BY ?local_identifier
@@values ?local_identifier
@@join ?local_identifier ?local_identifier type=left
-PREFIX pro:
-PREFIX foaf:
+@@with source=meta
+PREFIX fabio:
+
+SELECT ?local_identifier ?manifestation_type_class ?manifestation_type_label ?manifestation_type_label_lang ?manifestation_type_defined_in
+WHERE {
+ ?local_identifier a ?manifestation_type_class .
+ FILTER(?manifestation_type_class != fabio:Expression)
+ BIND(LCASE(REPLACE(REPLACE(STR(?manifestation_type_class), "^.*[/#]", ""), "([a-z])([A-Z])", "$1 $2")) AS ?manifestation_type_label)
+ BIND("en" AS ?manifestation_type_label_lang)
+ BIND(REPLACE(STR(?manifestation_type_class), "[/#][^/#]+$", "") AS ?manifestation_type_defined_in)
+}
+ORDER BY ?local_identifier ?manifestation_type_class
+
+@@values ?local_identifier
+@@join ?local_identifier ?local_identifier type=left
+@@with source=meta
+PREFIX prism:
+PREFIX frbr:
+
+SELECT ?local_identifier ?manifestation_biblio_pages_first ?manifestation_biblio_pages_last
+WHERE {
+ ?local_identifier frbr:embodiment ?resource_embodiment .
+ ?resource_embodiment prism:startingPage ?manifestation_biblio_pages_first ;
+ prism:endingPage ?manifestation_biblio_pages_last .
+}
+
+@@values ?local_identifier
+@@join ?local_identifier ?local_identifier type=left
+@@with source=meta
+PREFIX fabio:
+PREFIX frbr:
+
+SELECT ?local_identifier ?manifestation_biblio_issue
+WHERE {
+ ?local_identifier frbr:partOf ?journal_issue .
+ ?journal_issue a fabio:JournalIssue ;
+ fabio:hasSequenceIdentifier ?manifestation_biblio_issue .
+}
+
+@@values ?local_identifier
+@@join ?local_identifier ?local_identifier type=left
+@@with source=meta
+PREFIX fabio:
+PREFIX frbr:
+
+SELECT ?local_identifier ?manifestation_biblio_volume
+WHERE {
+ ?local_identifier frbr:partOf+ ?journal_volume .
+ ?journal_volume a fabio:JournalVolume ;
+ fabio:hasSequenceIdentifier ?manifestation_biblio_volume .
+}
+
+@@values ?local_identifier
+@@join ?local_identifier ?local_identifier type=left
+@@with source=meta
+PREFIX datacite:
+PREFIX literal:
+
+SELECT ?local_identifier ?identifier_scheme ?identifier_value
+WHERE {
+ ?local_identifier datacite:hasIdentifier ?identifier_node .
+ ?identifier_node datacite:usesIdentifierScheme ?identifier_scheme_uri ;
+ literal:hasLiteralValue ?identifier_value .
+ BIND(STRAFTER(STR(?identifier_scheme_uri), "http://purl.org/spar/datacite/") AS ?identifier_scheme)
+}
+ORDER BY ?local_identifier ?identifier_scheme ?identifier_value
+
+@@values ?local_identifier
+@@join ?local_identifier ?local_identifier type=left
+@@with source=meta
+PREFIX fabio:
+PREFIX dcterm:
+PREFIX frbr:
+
+SELECT DISTINCT ?local_identifier ?manifestation_biblio_in_name ?manifestation_biblio_in_local_identifier
+WHERE {
+ ?local_identifier frbr:partOf ?direct_container ;
+ frbr:partOf+ ?venue_resource .
+ ?venue_resource dcterm:title ?manifestation_biblio_in_name .
+ FILTER(
+ (?venue_resource = ?direct_container
+ && NOT EXISTS { ?venue_resource a fabio:JournalIssue }
+ && NOT EXISTS { ?venue_resource a fabio:JournalVolume })
+ || (EXISTS { ?local_identifier a fabio:JournalArticle } && EXISTS { ?venue_resource a fabio:Journal })
+ )
+ BIND(STR(?venue_resource) AS ?manifestation_biblio_in_local_identifier)
+}
+ORDER BY ?local_identifier ?manifestation_biblio_in_local_identifier
+
+@@values ?local_identifier
+@@join ?manifestation_biblio_in_local_identifier ?manifestation_biblio_in_local_identifier type=left
+@@with source=meta
+PREFIX frbr:
PREFIX datacite:
PREFIX literal:
+
+SELECT DISTINCT ?manifestation_biblio_in_local_identifier ?manifestation_biblio_in_identifier_scheme ?manifestation_biblio_in_identifier_value
+WHERE {
+ ?local_identifier frbr:partOf+ ?venue_resource .
+ ?venue_resource datacite:hasIdentifier ?venue_identifier_node .
+ ?venue_identifier_node datacite:usesIdentifierScheme ?venue_identifier_scheme_uri ;
+ literal:hasLiteralValue ?manifestation_biblio_in_identifier_value .
+ BIND(STRAFTER(STR(?venue_identifier_scheme_uri), "http://purl.org/spar/datacite/") AS ?manifestation_biblio_in_identifier_scheme)
+ BIND(STR(?venue_resource) AS ?manifestation_biblio_in_local_identifier)
+}
+ORDER BY ?manifestation_biblio_in_local_identifier ?manifestation_biblio_in_identifier_scheme ?manifestation_biblio_in_identifier_value
+
+@@values ?local_identifier
+@@join ?local_identifier ?local_identifier type=left
+@@with source=meta
+PREFIX pro:
+PREFIX foaf:
PREFIX oco:
SELECT ?local_identifier ?contribution_by_family_name ?contribution_by_given_name
- ?contribution_by_name ?contribution_by_identifier_scheme ?contribution_by_identifier_value
- ?contribution_by_local_identifier
+ ?contribution_by_name ?contribution_by_local_identifier
?contribution_role ?_contribution_key ?_contribution_next_key
WHERE {
?local_identifier pro:isDocumentContextFor ?agent_role .
?agent_role pro:withRole ?role_type ;
pro:isHeldBy ?responsible_agent .
- FILTER(?role_type IN (pro:author, pro:editor, pro:publisher))
- BIND(IF(?role_type = pro:author, "author", IF(?role_type = pro:editor, "editor", "publisher")) AS ?contribution_role)
+ BIND(IF(?role_type = pro:author, "author", IF(?role_type = pro:editor, "editor", IF(?role_type = pro:publisher, "publisher", ?_unbound))) AS ?contribution_role)
+ FILTER(BOUND(?contribution_role))
BIND(STR(?agent_role) AS ?_contribution_key)
- OPTIONAL {
- ?agent_role oco:hasNext ?next_agent_role .
- BIND(STR(?next_agent_role) AS ?_contribution_next_key)
- }
+ OPTIONAL { ?agent_role oco:hasNext ?next_agent_role }
+ BIND(STR(?next_agent_role) AS ?_contribution_next_key)
OPTIONAL { ?responsible_agent foaf:familyName ?contribution_by_family_name }
OPTIONAL { ?responsible_agent foaf:givenName ?contribution_by_given_name }
OPTIONAL { ?responsible_agent foaf:name ?contribution_by_name }
BIND(STR(?responsible_agent) AS ?contribution_by_local_identifier)
- OPTIONAL {
- ?responsible_agent datacite:hasIdentifier ?orcid_node .
- ?orcid_node datacite:usesIdentifierScheme datacite:orcid ;
- literal:hasLiteralValue ?contribution_by_identifier_value .
- BIND("orcid" AS ?contribution_by_identifier_scheme)
- }
+}
+
+@@values ?local_identifier
+@@join ?contribution_by_local_identifier ?contribution_by_local_identifier type=left
+@@with source=meta
+PREFIX datacite:
+PREFIX literal:
+PREFIX pro:
+
+SELECT DISTINCT ?contribution_by_local_identifier ?contribution_by_identifier_scheme ?contribution_by_identifier_value
+WHERE {
+ ?local_identifier pro:isDocumentContextFor ?agent_role .
+ ?agent_role pro:isHeldBy ?responsible_agent .
+ ?responsible_agent datacite:hasIdentifier ?orcid_node .
+ ?orcid_node datacite:usesIdentifierScheme datacite:orcid ;
+ literal:hasLiteralValue ?contribution_by_identifier_value .
+ BIND("orcid" AS ?contribution_by_identifier_scheme)
+ BIND(STR(?responsible_agent) AS ?contribution_by_local_identifier)
}
@@values ?local_identifier
@@ -1481,25 +1617,33 @@ WHERE {
}
#format skg_if,to_skg_if,application/json
#default_format skg_if
-#sparql PREFIX datacite:
-PREFIX literal:
-PREFIX foaf:
+#sparql PREFIX foaf:
-SELECT ?local_identifier ?name ?family_name ?given_name ?identifier_scheme ?identifier_value
+SELECT ?local_identifier ?name ?family_name
+ ?given_name ?identifier_scheme ?identifier_value
WHERE {
- BIND(<[[local_identifier]]> AS ?local_identifier)
- ?local_identifier a foaf:Agent.
- OPTIONAL { ?local_identifier foaf:familyName ?family_name . }
- OPTIONAL { ?local_identifier foaf:givenName ?given_name . }
- OPTIONAL { ?local_identifier foaf:name ?name. }
- OPTIONAL {
- ?local_identifier datacite:hasIdentifier ?identifier .
- ?identifier datacite:usesIdentifierScheme ?identifier_scheme_uri;
- literal:hasLiteralValue ?identifier_value.
- BIND(STRAFTER(STR(?identifier_scheme_uri), "http://purl.org/spar/datacite/") AS ?identifier_scheme)
- }
+ VALUES ?local_identifier { <[[local_identifier]]> }
+ ?local_identifier a foaf:Agent .
+ OPTIONAL { ?local_identifier foaf:familyName ?family_name }
+ OPTIONAL { ?local_identifier foaf:givenName ?given_name }
+ OPTIONAL { ?local_identifier foaf:name ?name }
FILTER(BOUND(?family_name) || BOUND(?given_name))
}
+ORDER BY ?local_identifier
+
+@@join ?local_identifier ?local_identifier type=left
+PREFIX datacite:
+PREFIX literal:
+
+SELECT ?local_identifier ?identifier_scheme ?identifier_value
+WHERE {
+ VALUES ?local_identifier { <[[local_identifier]]> }
+ ?local_identifier datacite:hasIdentifier ?identifier .
+ ?identifier datacite:usesIdentifierScheme ?identifier_scheme_uri ;
+ literal:hasLiteralValue ?identifier_value .
+ BIND(STRAFTER(STR(?identifier_scheme_uri), "http://purl.org/spar/datacite/") AS ?identifier_scheme)
+}
+ORDER BY ?local_identifier ?identifier_scheme ?identifier_value
#url /persons
#type operation
@@ -1558,29 +1702,49 @@ Filters in the first group use exact matching. For `cf.search.*`, matching is te
}
]
}
-#sparql PREFIX datacite:
+#sparql @@values ?local_identifier
+PREFIX datacite:
PREFIX literal:
PREFIX foaf:
-SELECT ?local_identifier ?name ?family_name ?given_name ?identifier_scheme ?identifier_value
+SELECT DISTINCT ?local_identifier
WHERE {
- ?local_identifier a foaf:Agent.
- OPTIONAL { ?local_identifier foaf:familyName ?family_name . }
- OPTIONAL { ?local_identifier foaf:givenName ?given_name . }
- OPTIONAL { ?local_identifier foaf:name ?name. }
- OPTIONAL {
- ?local_identifier datacite:hasIdentifier ?identifier .
- ?identifier datacite:usesIdentifierScheme ?identifier_scheme_uri;
- literal:hasLiteralValue ?identifier_value.
- BIND(STRAFTER(STR(?identifier_scheme_uri), "http://purl.org/spar/datacite/") AS ?identifier_scheme)
- }
- FILTER(BOUND(?family_name) || BOUND(?given_name))
+ ?local_identifier a foaf:Agent .
+ { ?local_identifier foaf:familyName ?family_name } UNION { ?local_identifier foaf:givenName ?given_name }
[[filter]]
}
ORDER BY ?local_identifier
@@page ?local_identifier default_size=10 max_size=100
+@@values ?local_identifier
+@@join ?local_identifier ?local_identifier type=left
+PREFIX foaf:
+
+SELECT ?local_identifier ?name ?family_name
+ ?given_name ?identifier_scheme ?identifier_value
+WHERE {
+ ?local_identifier a foaf:Agent .
+ OPTIONAL { ?local_identifier foaf:familyName ?family_name }
+ OPTIONAL { ?local_identifier foaf:givenName ?given_name }
+ OPTIONAL { ?local_identifier foaf:name ?name }
+}
+ORDER BY ?local_identifier
+
+@@values ?local_identifier
+@@join ?local_identifier ?local_identifier type=left
+PREFIX datacite:
+PREFIX literal:
+
+SELECT ?local_identifier ?identifier_scheme ?identifier_value
+WHERE {
+ ?local_identifier datacite:hasIdentifier ?identifier .
+ ?identifier datacite:usesIdentifierScheme ?identifier_scheme_uri ;
+ literal:hasLiteralValue ?identifier_value .
+ BIND(STRAFTER(STR(?identifier_scheme_uri), "http://purl.org/spar/datacite/") AS ?identifier_scheme)
+}
+ORDER BY ?local_identifier ?identifier_scheme ?identifier_value
+
#url /organisations/{local_identifier}
#type operation
#local_identifier str(https:/{1,2}w3id\.org/oc/meta/.+)
@@ -1612,24 +1776,32 @@ ORDER BY ?local_identifier
}
]
}
-#sparql PREFIX datacite:
-PREFIX literal:
-PREFIX foaf:
-SELECT ?local_identifier ?name ?identifier_scheme ?identifier_value
+#sparql PREFIX foaf:
+
+SELECT ?local_identifier ?name ?identifier_scheme
+ ?identifier_value
WHERE {
- BIND(<[[local_identifier]]> AS ?local_identifier)
+ VALUES ?local_identifier { <[[local_identifier]]> }
?local_identifier a foaf:Agent ;
foaf:name ?name .
- FILTER NOT EXISTS { ?local_identifier foaf:givenName ?givenName . }
- FILTER NOT EXISTS { ?local_identifier foaf:familyName ?familyName . }
+ FILTER NOT EXISTS { ?local_identifier foaf:givenName ?given_name }
+ FILTER NOT EXISTS { ?local_identifier foaf:familyName ?family_name }
+}
+ORDER BY ?local_identifier
- OPTIONAL {
- ?local_identifier datacite:hasIdentifier ?identifier .
- ?identifier datacite:usesIdentifierScheme ?identifier_scheme_uri ;
- literal:hasLiteralValue ?identifier_value .
- BIND(STRAFTER(STR(?identifier_scheme_uri), "http://purl.org/spar/datacite/") AS ?identifier_scheme)
- }
+@@join ?local_identifier ?local_identifier type=left
+PREFIX datacite:
+PREFIX literal:
+
+SELECT ?local_identifier ?identifier_scheme ?identifier_value
+WHERE {
+ VALUES ?local_identifier { <[[local_identifier]]> }
+ ?local_identifier datacite:hasIdentifier ?identifier .
+ ?identifier datacite:usesIdentifierScheme ?identifier_scheme_uri ;
+ literal:hasLiteralValue ?identifier_value .
+ BIND(STRAFTER(STR(?identifier_scheme_uri), "http://purl.org/spar/datacite/") AS ?identifier_scheme)
}
+ORDER BY ?local_identifier ?identifier_scheme ?identifier_value
#url /organisations
#type operation
@@ -1682,28 +1854,51 @@ Filters in the first group use exact matching. For `cf.search.*`, matching is te
}
]
}
-#sparql PREFIX datacite:
+#sparql @@values ?local_identifier
+PREFIX datacite:
PREFIX literal:
PREFIX foaf:
-SELECT ?local_identifier ?name ?identifier_scheme ?identifier_value
+
+SELECT DISTINCT ?local_identifier
WHERE {
?local_identifier a foaf:Agent ;
foaf:name ?name .
- FILTER NOT EXISTS { ?local_identifier foaf:givenName ?givenName . }
- FILTER NOT EXISTS { ?local_identifier foaf:familyName ?familyName . }
-
- OPTIONAL {
- ?local_identifier datacite:hasIdentifier ?identifier .
- ?identifier datacite:usesIdentifierScheme ?identifier_scheme_uri ;
- literal:hasLiteralValue ?identifier_value .
- BIND(STRAFTER(STR(?identifier_scheme_uri), "http://purl.org/spar/datacite/") AS ?identifier_scheme)
- }
+ FILTER NOT EXISTS { ?local_identifier foaf:givenName ?givenName }
+ FILTER NOT EXISTS { ?local_identifier foaf:familyName ?familyName }
[[filter]]
}
ORDER BY ?local_identifier
@@page ?local_identifier default_size=10 max_size=100
+@@values ?local_identifier
+@@join ?local_identifier ?local_identifier type=left
+PREFIX foaf:
+
+SELECT ?local_identifier ?name ?identifier_scheme
+ ?identifier_value
+WHERE {
+ ?local_identifier a foaf:Agent ;
+ foaf:name ?name .
+ FILTER NOT EXISTS { ?local_identifier foaf:givenName ?given_name }
+ FILTER NOT EXISTS { ?local_identifier foaf:familyName ?family_name }
+}
+ORDER BY ?local_identifier
+
+@@values ?local_identifier
+@@join ?local_identifier ?local_identifier type=left
+PREFIX datacite:
+PREFIX literal:
+
+SELECT ?local_identifier ?identifier_scheme ?identifier_value
+WHERE {
+ ?local_identifier datacite:hasIdentifier ?identifier .
+ ?identifier datacite:usesIdentifierScheme ?identifier_scheme_uri ;
+ literal:hasLiteralValue ?identifier_value .
+ BIND(STRAFTER(STR(?identifier_scheme_uri), "http://purl.org/spar/datacite/") AS ?identifier_scheme)
+}
+ORDER BY ?local_identifier ?identifier_scheme ?identifier_value
+
#url /venues/{local_identifier}
#type operation
#local_identifier str(https:/{1,2}w3id\.org/oc/meta/.+)
@@ -1740,35 +1935,40 @@ ORDER BY ?local_identifier
}
]
}
-#sparql PREFIX datacite:
+#sparql PREFIX fabio:
PREFIX dcterms:
-PREFIX literal:
PREFIX frbr:
-PREFIX fabio:
-SELECT ?local_identifier ?name ?identifier_scheme ?identifier_value ?type
+SELECT ?local_identifier ?name ?type
+ ?identifier_scheme ?identifier_value
WHERE {
- BIND(<[[local_identifier]]> AS ?local_identifier)
- ?br frbr:partOf+ ?local_identifier .
- FILTER NOT EXISTS { ?local_identifier frbr:partOf ?parent. }
+ VALUES ?local_identifier { <[[local_identifier]]> }
+ FILTER EXISTS { ?br frbr:partOf ?local_identifier }
+ FILTER NOT EXISTS { ?local_identifier frbr:partOf ?parent }
?local_identifier a ?type_uri .
FILTER(?type_uri != fabio:Expression)
- OPTIONAL {
- ?local_identifier dcterms:title ?name .
- }
- OPTIONAL {
- ?local_identifier datacite:hasIdentifier ?identifier .
- ?identifier datacite:usesIdentifierScheme ?identifier_scheme_uri ;
- literal:hasLiteralValue ?identifier_value .
- BIND(STRAFTER(STR(?identifier_scheme_uri), "http://purl.org/spar/datacite/") AS ?identifier_scheme)
- }
+ OPTIONAL { ?local_identifier dcterms:title ?name }
BIND(
- IF(!BOUND(?type_uri), "unknown",
IF(?type_uri = fabio:Journal, "journal",
IF(?type_uri = fabio:AcademicProceedings, "conference",
IF(?type_uri = fabio:Book || ?type_uri = fabio:ReferenceBook, "book", "other")))
- ) AS ?type)
+ AS ?type)
+}
+ORDER BY ?local_identifier ?type
+
+@@join ?local_identifier ?local_identifier type=left
+PREFIX datacite:
+PREFIX literal:
+
+SELECT ?local_identifier ?identifier_scheme ?identifier_value
+WHERE {
+ VALUES ?local_identifier { <[[local_identifier]]> }
+ ?local_identifier datacite:hasIdentifier ?identifier .
+ ?identifier datacite:usesIdentifierScheme ?identifier_scheme_uri ;
+ literal:hasLiteralValue ?identifier_value .
+ BIND(STRAFTER(STR(?identifier_scheme_uri), "http://purl.org/spar/datacite/") AS ?identifier_scheme)
}
+ORDER BY ?local_identifier ?identifier_scheme ?identifier_value
#url /venues
#type operation
@@ -1827,38 +2027,60 @@ Filters in the first group use exact matching. For `cf.search.*`, matching is te
}
]
}
-#sparql PREFIX datacite:
-PREFIX dcterms:
+#sparql @@values ?local_identifier
+PREFIX datacite:
PREFIX literal:
+PREFIX dcterms:
PREFIX frbr:
PREFIX fabio:
-SELECT ?local_identifier ?name ?identifier_scheme ?identifier_value ?type
+SELECT DISTINCT ?local_identifier
WHERE {
- ?br frbr:partOf+ ?local_identifier .
- FILTER NOT EXISTS { ?local_identifier frbr:partOf ?parent. }
+ FILTER EXISTS { ?br frbr:partOf ?local_identifier }
+ FILTER NOT EXISTS { ?local_identifier frbr:partOf ?parent }
?local_identifier a ?type_uri .
FILTER(?type_uri != fabio:Expression)
- OPTIONAL {
- ?local_identifier dcterms:title ?name .
- }
- OPTIONAL {
- ?local_identifier datacite:hasIdentifier ?identifier .
- ?identifier datacite:usesIdentifierScheme ?identifier_scheme_uri ;
- literal:hasLiteralValue ?identifier_value .
- BIND(STRAFTER(STR(?identifier_scheme_uri), "http://purl.org/spar/datacite/") AS ?identifier_scheme)
- }
+ [[filter]]
+}
+ORDER BY ?local_identifier
+
+@@page ?local_identifier default_size=10 max_size=100
+
+@@values ?local_identifier
+@@join ?local_identifier ?local_identifier type=left
+PREFIX fabio:
+PREFIX dcterms:
+PREFIX frbr:
+
+SELECT ?local_identifier ?name ?type
+ ?identifier_scheme ?identifier_value
+WHERE {
+ FILTER EXISTS { ?br frbr:partOf ?local_identifier }
+ FILTER NOT EXISTS { ?local_identifier frbr:partOf ?parent }
+ ?local_identifier a ?type_uri .
+ FILTER(?type_uri != fabio:Expression)
+ OPTIONAL { ?local_identifier dcterms:title ?name }
BIND(
- IF(!BOUND(?type_uri), "unknown",
IF(?type_uri = fabio:Journal, "journal",
IF(?type_uri = fabio:AcademicProceedings, "conference",
IF(?type_uri = fabio:Book || ?type_uri = fabio:ReferenceBook, "book", "other")))
- ) AS ?type)
- [[filter]]
+ AS ?type)
}
-ORDER BY ?local_identifier
+ORDER BY ?local_identifier ?type
-@@page ?local_identifier default_size=10 max_size=100
+@@values ?local_identifier
+@@join ?local_identifier ?local_identifier type=left
+PREFIX datacite:
+PREFIX literal:
+
+SELECT ?local_identifier ?identifier_scheme ?identifier_value
+WHERE {
+ ?local_identifier datacite:hasIdentifier ?identifier .
+ ?identifier datacite:usesIdentifierScheme ?identifier_scheme_uri ;
+ literal:hasLiteralValue ?identifier_value .
+ BIND(STRAFTER(STR(?identifier_scheme_uri), "http://purl.org/spar/datacite/") AS ?identifier_scheme)
+}
+ORDER BY ?local_identifier ?identifier_scheme ?identifier_value
#url /grants/{local_identifier}
#type operation
diff --git a/test/conftest.py b/test/conftest.py
index 2a9746f..59ba7a9 100644
--- a/test/conftest.py
+++ b/test/conftest.py
@@ -1,5 +1,4 @@
import os
-import shutil
import subprocess
import tempfile
import time
@@ -9,23 +8,15 @@
from ramose import APIManager, Operation
-# v0.5.45
-QLEVER_IMAGE = "adfreiburg/qlever@sha256:4672a53f0ff4e55ac921d25832a21ec0bb3ca08f54d7c1950d04ebf6af7b8c21"
+# v0.6.0
+QLEVER_IMAGE = "adfreiburg/qlever@sha256:37d5ede193f1bffb6aebf734d15d2a4c2a3228ee102858b0c6c2e65c149a78ec"
QLEVER_CONTAINER = "oc-api-test-qlever"
QLEVER_PORT = 7011
-INDEX_NAME = "oc-index-test"
+INDEX_NAME = "oc-test"
DOCKER_USER = f"{os.getuid()}:{os.getgid()}"
-# v7.2.16
-VIRTUOSO_IMAGE = "openlink/virtuoso-opensource-7@sha256:e7a5cd1915569d70d8363503dc62f6bf818b485f1501b230c7608cde8528c72d"
-VIRTUOSO_CONTAINER = "oc-api-test-virtuoso"
-VIRTUOSO_HTTP_PORT = 8893
-VIRTUOSO_ISQL_PORT = 1112
-
TEST_DIR = os.path.dirname(os.path.abspath(__file__))
-QLEVER_DATA_DIR = os.path.join(TEST_DIR, "qlever-index-data")
-VIRTUOSO_DATA_DIR = os.path.join(TEST_DIR, "virtuoso-meta-data")
-VIRTUOSO_DB_DIR = os.path.join(VIRTUOSO_DATA_DIR, "database")
+QLEVER_DATA_DIR = os.path.join(TEST_DIR, "qlever-data")
def _wait_for_http(port: int, timeout: int = 60) -> None:
@@ -41,41 +32,6 @@ def _wait_for_http(port: int, timeout: int = 60) -> None:
raise TimeoutError(f"Service did not become ready on port {port} within {timeout}s")
-def _wait_for_virtuoso(container: str, timeout: int = 60) -> None:
- deadline = time.monotonic() + timeout
- while time.monotonic() < deadline:
- result = subprocess.run(
- [
- "docker",
- "exec",
- container,
- "isql",
- "1111",
- "dba",
- "dba",
- "exec=SELECT 1;",
- ],
- capture_output=True,
- )
- if result.returncode == 0:
- return
- time.sleep(1)
- raise TimeoutError(f"Virtuoso did not become ready within {timeout}s")
-
-
-def _enable_virtuoso_rdf_freetext(container: str) -> None:
- commands = (
- "DB.DBA.RDF_OBJ_FT_RULE_ADD(null, null, 'All');"
- "DB.DBA.VT_INC_INDEX_DB_DBA_RDF_OBJ();"
- "checkpoint;"
- )
- subprocess.run(
- ["docker", "exec", container, "isql", "1111", "dba", "dba", f"exec={commands}"],
- check=True,
- capture_output=True,
- )
-
-
@pytest.fixture(scope="session")
def qlever_endpoint():
subprocess.run(["docker", "rm", "-f", QLEVER_CONTAINER], capture_output=True)
@@ -99,7 +55,7 @@ def qlever_endpoint():
"--init",
QLEVER_IMAGE,
"-c",
- f"qlever-server -i {INDEX_NAME} -j 4 -p {QLEVER_PORT} -m 1G -c 500M -e 500M -k 50 -s 30s",
+ f"qlever-server -i {INDEX_NAME} -j 4 -p {QLEVER_PORT} -m 1G -c 500M -e 500M -k 50 -s 30s --no-metrics-log --no-resource-usage-log",
],
check=True,
capture_output=True,
@@ -111,50 +67,13 @@ def qlever_endpoint():
@pytest.fixture(scope="session")
-def virtuoso_endpoint():
- with tempfile.TemporaryDirectory() as temp_dir:
- database_dir = os.path.join(temp_dir, "database")
- os.mkdir(database_dir)
- for entry in os.scandir(VIRTUOSO_DB_DIR):
- if entry.is_file() and entry.name != "virtuoso.log":
- shutil.copy2(entry.path, database_dir)
-
- subprocess.run(["docker", "rm", "-f", VIRTUOSO_CONTAINER], capture_output=True)
- subprocess.run(
- [
- "docker",
- "run",
- "-d",
- "--name",
- VIRTUOSO_CONTAINER,
- "-p",
- f"{VIRTUOSO_HTTP_PORT}:8890",
- "-p",
- f"{VIRTUOSO_ISQL_PORT}:1111",
- "-e",
- "DBA_PASSWORD=dba",
- "-v",
- f"{database_dir}:/opt/virtuoso-opensource/database",
- VIRTUOSO_IMAGE,
- ],
- check=True,
- capture_output=True,
- )
- _wait_for_virtuoso(VIRTUOSO_CONTAINER)
- _enable_virtuoso_rdf_freetext(VIRTUOSO_CONTAINER)
- yield f"http://127.0.0.1:{VIRTUOSO_HTTP_PORT}/sparql"
- subprocess.run(["docker", "stop", VIRTUOSO_CONTAINER], capture_output=True)
- subprocess.run(["docker", "rm", "-f", VIRTUOSO_CONTAINER], capture_output=True)
-
-
-@pytest.fixture(scope="session")
-def skgif_api_manager(virtuoso_endpoint, qlever_endpoint):
+def skgif_api_manager(qlever_endpoint):
manager = APIManager(
[os.path.join(TEST_DIR, "..", "src", "api", "skgif_v1.hf")],
- endpoint_override=virtuoso_endpoint,
+ endpoint_override=qlever_endpoint,
)
for config in manager.all_conf.values():
- config["sources_map"] = {"meta": virtuoso_endpoint, "index": qlever_endpoint}
+ config["sources_map"] = {"meta": qlever_endpoint, "index": qlever_endpoint}
return manager
@@ -181,11 +100,7 @@ def execute_operation(api_manager: APIManager, operation_url: str) -> str:
return response.body
-def create_api_manager(
- config_path: str,
- replacements: dict[str, str],
- env_vars: dict[str, str] | None = None,
-) -> APIManager:
+def create_api_manager(config_path: str, replacements: dict[str, str]) -> APIManager:
full_config_path = os.path.join(TEST_DIR, "..", config_path)
with open(full_config_path, "r", encoding="utf8") as f:
@@ -194,10 +109,6 @@ def create_api_manager(
for old, new in replacements.items():
config_content = config_content.replace(old, new)
- if env_vars:
- for key, value in env_vars.items():
- os.environ[key] = value
-
tmp_file = tempfile.NamedTemporaryFile(
mode="w", suffix=".hf", delete=False, dir=TEST_DIR
)
diff --git a/test/data/expected_search_products.json b/test/data/expected_search_products.json
index cb4e36b..e951a50 100644
--- a/test/data/expected_search_products.json
+++ b/test/data/expected_search_products.json
@@ -68,10 +68,10 @@
{
"type": {
"class": "http://purl.org/spar/fabio/JournalArticle",
- "defined_in": "http://purl.org/spar/fabio",
"labels": {
"en": "journal article"
- }
+ },
+ "defined_in": "http://purl.org/spar/fabio"
},
"dates": {
"publication": [
@@ -87,16 +87,16 @@
"local_identifier": "https://w3id.org/oc/meta/br/06160781188",
"identifiers": [
{
- "value": "S110615584",
- "scheme": "openalex"
+ "value": "1432-1300",
+ "scheme": "issn"
},
{
"value": "1432-5012",
"scheme": "issn"
},
{
- "value": "1432-1300",
- "scheme": "issn"
+ "value": "S110615584",
+ "scheme": "openalex"
}
]
}
@@ -119,13 +119,13 @@
]
},
"identifiers": [
- {
- "value": "W2938946739",
- "scheme": "openalex"
- },
{
"value": "10.1007/s11192-019-03217-6",
"scheme": "doi"
+ },
+ {
+ "value": "W2938946739",
+ "scheme": "openalex"
}
],
"contributions": [
@@ -194,10 +194,10 @@
{
"type": {
"class": "http://purl.org/spar/fabio/JournalArticle",
- "defined_in": "http://purl.org/spar/fabio",
"labels": {
"en": "journal article"
- }
+ },
+ "defined_in": "http://purl.org/spar/fabio"
},
"dates": {
"publication": [
@@ -216,6 +216,10 @@
"entity_type": "venue",
"local_identifier": "https://w3id.org/oc/meta/br/0626055628",
"identifiers": [
+ {
+ "value": "0138-9130",
+ "scheme": "issn"
+ },
{
"value": "1588-2861",
"scheme": "issn"
@@ -223,10 +227,6 @@
{
"value": "S148561398",
"scheme": "openalex"
- },
- {
- "value": "0138-9130",
- "scheme": "issn"
}
]
}
@@ -349,10 +349,10 @@
{
"type": {
"class": "http://purl.org/spar/fabio/JournalArticle",
- "defined_in": "http://purl.org/spar/fabio",
"labels": {
"en": "journal article"
- }
+ },
+ "defined_in": "http://purl.org/spar/fabio"
},
"dates": {
"publication": [
@@ -444,13 +444,13 @@
]
},
"identifiers": [
- {
- "value": "W3106215946",
- "scheme": "openalex"
- },
{
"value": "10.1162/qss_a_00023",
"scheme": "doi"
+ },
+ {
+ "value": "W3106215946",
+ "scheme": "openalex"
}
],
"contributions": [
@@ -502,10 +502,10 @@
{
"type": {
"class": "http://purl.org/spar/fabio/JournalArticle",
- "defined_in": "http://purl.org/spar/fabio",
"labels": {
"en": "journal article"
- }
+ },
+ "defined_in": "http://purl.org/spar/fabio"
},
"dates": {
"publication": [
@@ -524,13 +524,13 @@
"entity_type": "venue",
"local_identifier": "https://w3id.org/oc/meta/br/062501778099",
"identifiers": [
- {
- "value": "S4210195326",
- "scheme": "openalex"
- },
{
"value": "2641-3337",
"scheme": "issn"
+ },
+ {
+ "value": "S4210195326",
+ "scheme": "openalex"
}
]
}
@@ -636,10 +636,10 @@
{
"type": {
"class": "http://purl.org/spar/fabio/JournalArticle",
- "defined_in": "http://purl.org/spar/fabio",
"labels": {
"en": "journal article"
- }
+ },
+ "defined_in": "http://purl.org/spar/fabio"
},
"dates": {
"publication": [
@@ -653,11 +653,11 @@
"local_identifier": "https://w3id.org/oc/meta/br/0626055628",
"identifiers": [
{
- "value": "1588-2861",
+ "value": "0138-9130",
"scheme": "issn"
},
{
- "value": "0138-9130",
+ "value": "1588-2861",
"scheme": "issn"
},
{
@@ -685,13 +685,13 @@
]
},
"identifiers": [
- {
- "value": "W4285173206",
- "scheme": "openalex"
- },
{
"value": "10.1007/978-3-031-06981-9_18",
"scheme": "doi"
+ },
+ {
+ "value": "W4285173206",
+ "scheme": "openalex"
}
],
"contributions": [
@@ -754,10 +754,10 @@
{
"type": {
"class": "http://purl.org/spar/fabio/BookChapter",
- "defined_in": "http://purl.org/spar/fabio",
"labels": {
"en": "book chapter"
- }
+ },
+ "defined_in": "http://purl.org/spar/fabio"
},
"dates": {
"publication": [
@@ -775,11 +775,11 @@
"local_identifier": "https://w3id.org/oc/meta/br/06401297735",
"identifiers": [
{
- "value": "9783031069819",
+ "value": "9783031069802",
"scheme": "isbn"
},
{
- "value": "9783031069802",
+ "value": "9783031069819",
"scheme": "isbn"
}
]
@@ -920,10 +920,10 @@
{
"type": {
"class": "http://purl.org/spar/fabio/JournalArticle",
- "defined_in": "http://purl.org/spar/fabio",
"labels": {
"en": "journal article"
- }
+ },
+ "defined_in": "http://purl.org/spar/fabio"
},
"dates": {
"publication": [
@@ -971,13 +971,13 @@
"value": "9783319580678",
"scheme": "isbn"
},
- {
- "value": "W3115553721",
- "scheme": "openalex"
- },
{
"value": "9783319580685",
"scheme": "isbn"
+ },
+ {
+ "value": "W3115553721",
+ "scheme": "openalex"
}
],
"contributions": [
@@ -1061,10 +1061,10 @@
{
"type": {
"class": "http://purl.org/spar/fabio/Book",
- "defined_in": "http://purl.org/spar/fabio",
"labels": {
"en": "book"
- }
+ },
+ "defined_in": "http://purl.org/spar/fabio"
},
"dates": {
"publication": [
@@ -1078,19 +1078,19 @@
"local_identifier": "https://w3id.org/oc/meta/br/069066063",
"identifiers": [
{
- "value": "1864-3035",
+ "value": "0302-9743",
"scheme": "issn"
},
{
- "value": "1861-2067",
+ "value": "1611-3349",
"scheme": "issn"
},
{
- "value": "1867-7754",
+ "value": "1861-2032",
"scheme": "issn"
},
{
- "value": "1611-3349",
+ "value": "1861-2040",
"scheme": "issn"
},
{
@@ -1098,15 +1098,15 @@
"scheme": "issn"
},
{
- "value": "0302-9743",
+ "value": "1861-2067",
"scheme": "issn"
},
{
- "value": "1861-2040",
+ "value": "1864-3035",
"scheme": "issn"
},
{
- "value": "1861-2032",
+ "value": "1867-7754",
"scheme": "issn"
}
]
@@ -1126,20 +1126,20 @@
},
"identifiers": [
{
- "value": "9783319476025",
- "scheme": "isbn"
+ "value": "10.1007/978-3-319-47602-5",
+ "scheme": "doi"
},
{
"value": "9783319476018",
"scheme": "isbn"
},
{
- "value": "W4245488324",
- "scheme": "openalex"
+ "value": "9783319476025",
+ "scheme": "isbn"
},
{
- "value": "10.1007/978-3-319-47602-5",
- "scheme": "doi"
+ "value": "W4245488324",
+ "scheme": "openalex"
}
],
"contributions": [
@@ -1235,10 +1235,10 @@
{
"type": {
"class": "http://purl.org/spar/fabio/Book",
- "defined_in": "http://purl.org/spar/fabio",
"labels": {
"en": "book"
- }
+ },
+ "defined_in": "http://purl.org/spar/fabio"
},
"dates": {
"publication": [
@@ -1252,19 +1252,19 @@
"local_identifier": "https://w3id.org/oc/meta/br/069066063",
"identifiers": [
{
- "value": "1864-3035",
+ "value": "0302-9743",
"scheme": "issn"
},
{
- "value": "1861-2067",
+ "value": "1611-3349",
"scheme": "issn"
},
{
- "value": "1867-7754",
+ "value": "1861-2032",
"scheme": "issn"
},
{
- "value": "1611-3349",
+ "value": "1861-2040",
"scheme": "issn"
},
{
@@ -1272,15 +1272,15 @@
"scheme": "issn"
},
{
- "value": "0302-9743",
+ "value": "1861-2067",
"scheme": "issn"
},
{
- "value": "1861-2040",
+ "value": "1864-3035",
"scheme": "issn"
},
{
- "value": "1861-2032",
+ "value": "1867-7754",
"scheme": "issn"
}
]
@@ -1300,20 +1300,20 @@
},
"identifiers": [
{
- "value": "W2784292677",
- "scheme": "openalex"
+ "value": "10.1007/978-3-319-11955-7",
+ "scheme": "doi"
},
{
"value": "9783319119540",
"scheme": "isbn"
},
- {
- "value": "10.1007/978-3-319-11955-7",
- "scheme": "doi"
- },
{
"value": "9783319119557",
"scheme": "isbn"
+ },
+ {
+ "value": "W2784292677",
+ "scheme": "openalex"
}
],
"contributions": [
@@ -1397,10 +1397,10 @@
{
"type": {
"class": "http://purl.org/spar/fabio/Book",
- "defined_in": "http://purl.org/spar/fabio",
"labels": {
"en": "book"
- }
+ },
+ "defined_in": "http://purl.org/spar/fabio"
},
"dates": {
"publication": [
@@ -1414,19 +1414,19 @@
"local_identifier": "https://w3id.org/oc/meta/br/069066063",
"identifiers": [
{
- "value": "1864-3035",
+ "value": "0302-9743",
"scheme": "issn"
},
{
- "value": "1861-2067",
+ "value": "1611-3349",
"scheme": "issn"
},
{
- "value": "1867-7754",
+ "value": "1861-2032",
"scheme": "issn"
},
{
- "value": "1611-3349",
+ "value": "1861-2040",
"scheme": "issn"
},
{
@@ -1434,15 +1434,15 @@
"scheme": "issn"
},
{
- "value": "0302-9743",
+ "value": "1861-2067",
"scheme": "issn"
},
{
- "value": "1861-2040",
+ "value": "1864-3035",
"scheme": "issn"
},
{
- "value": "1861-2032",
+ "value": "1867-7754",
"scheme": "issn"
}
]
@@ -1461,10 +1461,6 @@
]
},
"identifiers": [
- {
- "value": "W4249829199",
- "scheme": "openalex"
- },
{
"value": "10.1007/978-1-4020-9632-7",
"scheme": "doi"
@@ -1476,6 +1472,10 @@
{
"value": "9789048127108",
"scheme": "isbn"
+ },
+ {
+ "value": "W4249829199",
+ "scheme": "openalex"
}
],
"contributions": [
@@ -1521,10 +1521,10 @@
{
"type": {
"class": "http://purl.org/spar/fabio/Book",
- "defined_in": "http://purl.org/spar/fabio",
"labels": {
"en": "book"
- }
+ },
+ "defined_in": "http://purl.org/spar/fabio"
},
"dates": {
"publication": [
@@ -1544,14 +1544,6 @@
]
},
"identifiers": [
- {
- "value": "9783642308598",
- "scheme": "isbn"
- },
- {
- "value": "W2221102889",
- "scheme": "openalex"
- },
{
"value": "10.1007/978-3-642-30859-8",
"scheme": "doi"
@@ -1559,6 +1551,14 @@
{
"value": "9783642308581",
"scheme": "isbn"
+ },
+ {
+ "value": "9783642308598",
+ "scheme": "isbn"
+ },
+ {
+ "value": "W2221102889",
+ "scheme": "openalex"
}
],
"contributions": [
@@ -1632,10 +1632,10 @@
{
"type": {
"class": "http://purl.org/spar/fabio/Book",
- "defined_in": "http://purl.org/spar/fabio",
"labels": {
"en": "book"
- }
+ },
+ "defined_in": "http://purl.org/spar/fabio"
},
"dates": {
"publication": [
@@ -1689,10 +1689,10 @@
{
"type": {
"class": "http://purl.org/spar/fabio/Book",
- "defined_in": "http://purl.org/spar/fabio",
"labels": {
"en": "book"
- }
+ },
+ "defined_in": "http://purl.org/spar/fabio"
}
}
],
@@ -1720,10 +1720,10 @@
{
"type": {
"class": "http://purl.org/spar/fabio/Book",
- "defined_in": "http://purl.org/spar/fabio",
"labels": {
"en": "book"
- }
+ },
+ "defined_in": "http://purl.org/spar/fabio"
}
}
],
@@ -1751,10 +1751,10 @@
{
"type": {
"class": "http://purl.org/spar/fabio/Book",
- "defined_in": "http://purl.org/spar/fabio",
"labels": {
"en": "book"
- }
+ },
+ "defined_in": "http://purl.org/spar/fabio"
}
}
],
@@ -1769,10 +1769,6 @@
]
},
"identifiers": [
- {
- "value": "9789264799318",
- "scheme": "isbn"
- },
{
"value": "10.1787/b0e499cf-en",
"scheme": "doi"
@@ -1786,12 +1782,16 @@
"scheme": "isbn"
},
{
- "value": "W4221051054",
- "scheme": "openalex"
+ "value": "9789264799318",
+ "scheme": "isbn"
},
{
"value": "9789264960114",
"scheme": "isbn"
+ },
+ {
+ "value": "W4221051054",
+ "scheme": "openalex"
}
],
"contributions": [
@@ -1818,10 +1818,10 @@
{
"type": {
"class": "http://purl.org/spar/fabio/Book",
- "defined_in": "http://purl.org/spar/fabio",
"labels": {
"en": "book"
- }
+ },
+ "defined_in": "http://purl.org/spar/fabio"
},
"dates": {
"publication": [
@@ -1861,20 +1861,20 @@
},
"identifiers": [
{
- "value": "9781402096327",
- "scheme": "isbn"
+ "value": "10.1007/978-1-4020-9632-7",
+ "scheme": "doi"
},
{
- "value": "W4249829199",
- "scheme": "openalex"
+ "value": "9781402096327",
+ "scheme": "isbn"
},
{
"value": "9789048127108",
"scheme": "isbn"
},
{
- "value": "10.1007/978-1-4020-9632-7",
- "scheme": "doi"
+ "value": "W4249829199",
+ "scheme": "openalex"
}
],
"contributions": [
@@ -1920,10 +1920,10 @@
{
"type": {
"class": "http://purl.org/spar/fabio/Book",
- "defined_in": "http://purl.org/spar/fabio",
"labels": {
"en": "book"
- }
+ },
+ "defined_in": "http://purl.org/spar/fabio"
},
"dates": {
"publication": [
@@ -2004,10 +2004,10 @@
{
"type": {
"class": "http://purl.org/spar/fabio/JournalArticle",
- "defined_in": "http://purl.org/spar/fabio",
"labels": {
"en": "journal article"
- }
+ },
+ "defined_in": "http://purl.org/spar/fabio"
},
"dates": {
"publication": [
@@ -2023,16 +2023,16 @@
"local_identifier": "https://w3id.org/oc/meta/br/06160781188",
"identifiers": [
{
- "value": "S110615584",
- "scheme": "openalex"
+ "value": "1432-1300",
+ "scheme": "issn"
},
{
"value": "1432-5012",
"scheme": "issn"
},
{
- "value": "1432-1300",
- "scheme": "issn"
+ "value": "S110615584",
+ "scheme": "openalex"
}
]
}
@@ -2055,13 +2055,13 @@
]
},
"identifiers": [
- {
- "value": "W2938946739",
- "scheme": "openalex"
- },
{
"value": "10.1007/s11192-019-03217-6",
"scheme": "doi"
+ },
+ {
+ "value": "W2938946739",
+ "scheme": "openalex"
}
],
"contributions": [
@@ -2130,10 +2130,10 @@
{
"type": {
"class": "http://purl.org/spar/fabio/JournalArticle",
- "defined_in": "http://purl.org/spar/fabio",
"labels": {
"en": "journal article"
- }
+ },
+ "defined_in": "http://purl.org/spar/fabio"
},
"dates": {
"publication": [
@@ -2152,6 +2152,10 @@
"entity_type": "venue",
"local_identifier": "https://w3id.org/oc/meta/br/0626055628",
"identifiers": [
+ {
+ "value": "0138-9130",
+ "scheme": "issn"
+ },
{
"value": "1588-2861",
"scheme": "issn"
@@ -2159,10 +2163,6 @@
{
"value": "S148561398",
"scheme": "openalex"
- },
- {
- "value": "0138-9130",
- "scheme": "issn"
}
]
}
@@ -2285,10 +2285,10 @@
{
"type": {
"class": "http://purl.org/spar/fabio/JournalArticle",
- "defined_in": "http://purl.org/spar/fabio",
"labels": {
"en": "journal article"
- }
+ },
+ "defined_in": "http://purl.org/spar/fabio"
},
"dates": {
"publication": [
@@ -2380,13 +2380,13 @@
]
},
"identifiers": [
- {
- "value": "W3106215946",
- "scheme": "openalex"
- },
{
"value": "10.1162/qss_a_00023",
"scheme": "doi"
+ },
+ {
+ "value": "W3106215946",
+ "scheme": "openalex"
}
],
"contributions": [
@@ -2438,10 +2438,10 @@
{
"type": {
"class": "http://purl.org/spar/fabio/JournalArticle",
- "defined_in": "http://purl.org/spar/fabio",
"labels": {
"en": "journal article"
- }
+ },
+ "defined_in": "http://purl.org/spar/fabio"
},
"dates": {
"publication": [
@@ -2460,13 +2460,13 @@
"entity_type": "venue",
"local_identifier": "https://w3id.org/oc/meta/br/062501778099",
"identifiers": [
- {
- "value": "S4210195326",
- "scheme": "openalex"
- },
{
"value": "2641-3337",
"scheme": "issn"
+ },
+ {
+ "value": "S4210195326",
+ "scheme": "openalex"
}
]
}
@@ -2572,10 +2572,10 @@
{
"type": {
"class": "http://purl.org/spar/fabio/JournalArticle",
- "defined_in": "http://purl.org/spar/fabio",
"labels": {
"en": "journal article"
- }
+ },
+ "defined_in": "http://purl.org/spar/fabio"
},
"dates": {
"publication": [
@@ -2589,11 +2589,11 @@
"local_identifier": "https://w3id.org/oc/meta/br/0626055628",
"identifiers": [
{
- "value": "1588-2861",
+ "value": "0138-9130",
"scheme": "issn"
},
{
- "value": "0138-9130",
+ "value": "1588-2861",
"scheme": "issn"
},
{
@@ -2621,13 +2621,13 @@
]
},
"identifiers": [
- {
- "value": "W4285173206",
- "scheme": "openalex"
- },
{
"value": "10.1007/978-3-031-06981-9_18",
"scheme": "doi"
+ },
+ {
+ "value": "W4285173206",
+ "scheme": "openalex"
}
],
"contributions": [
@@ -2690,10 +2690,10 @@
{
"type": {
"class": "http://purl.org/spar/fabio/BookChapter",
- "defined_in": "http://purl.org/spar/fabio",
"labels": {
"en": "book chapter"
- }
+ },
+ "defined_in": "http://purl.org/spar/fabio"
},
"dates": {
"publication": [
@@ -2711,11 +2711,11 @@
"local_identifier": "https://w3id.org/oc/meta/br/06401297735",
"identifiers": [
{
- "value": "9783031069819",
+ "value": "9783031069802",
"scheme": "isbn"
},
{
- "value": "9783031069802",
+ "value": "9783031069819",
"scheme": "isbn"
}
]
@@ -2856,10 +2856,10 @@
{
"type": {
"class": "http://purl.org/spar/fabio/JournalArticle",
- "defined_in": "http://purl.org/spar/fabio",
"labels": {
"en": "journal article"
- }
+ },
+ "defined_in": "http://purl.org/spar/fabio"
},
"dates": {
"publication": [
@@ -2941,10 +2941,10 @@
{
"type": {
"class": "http://purl.org/spar/fabio/JournalArticle",
- "defined_in": "http://purl.org/spar/fabio",
"labels": {
"en": "journal article"
- }
+ },
+ "defined_in": "http://purl.org/spar/fabio"
},
"dates": {
"publication": [
@@ -2963,10 +2963,6 @@
"entity_type": "venue",
"local_identifier": "https://w3id.org/oc/meta/br/06101018",
"identifiers": [
- {
- "value": "1096-9926",
- "scheme": "issn"
- },
{
"value": "10.1002/(issn)1096-9926",
"scheme": "doi"
@@ -2974,6 +2970,10 @@
{
"value": "0040-3709",
"scheme": "issn"
+ },
+ {
+ "value": "1096-9926",
+ "scheme": "issn"
}
]
}
@@ -3040,10 +3040,10 @@
{
"type": {
"class": "http://purl.org/spar/fabio/JournalArticle",
- "defined_in": "http://purl.org/spar/fabio",
"labels": {
"en": "journal article"
- }
+ },
+ "defined_in": "http://purl.org/spar/fabio"
},
"dates": {
"publication": [
@@ -3062,10 +3062,6 @@
"entity_type": "venue",
"local_identifier": "https://w3id.org/oc/meta/br/06101018",
"identifiers": [
- {
- "value": "1096-9926",
- "scheme": "issn"
- },
{
"value": "10.1002/(issn)1096-9926",
"scheme": "doi"
@@ -3073,6 +3069,10 @@
{
"value": "0040-3709",
"scheme": "issn"
+ },
+ {
+ "value": "1096-9926",
+ "scheme": "issn"
}
]
}
@@ -3393,10 +3393,10 @@
{
"type": {
"class": "http://purl.org/spar/fabio/ReportDocument",
- "defined_in": "http://purl.org/spar/fabio",
"labels": {
"en": "report document"
- }
+ },
+ "defined_in": "http://purl.org/spar/fabio"
},
"dates": {
"publication": [
@@ -3460,10 +3460,10 @@
{
"type": {
"class": "http://purl.org/spar/fabio/JournalArticle",
- "defined_in": "http://purl.org/spar/fabio",
"labels": {
"en": "journal article"
- }
+ },
+ "defined_in": "http://purl.org/spar/fabio"
},
"dates": {
"publication": [
@@ -3482,10 +3482,6 @@
"entity_type": "venue",
"local_identifier": "https://w3id.org/oc/meta/br/06101018",
"identifiers": [
- {
- "value": "1096-9926",
- "scheme": "issn"
- },
{
"value": "10.1002/(issn)1096-9926",
"scheme": "doi"
@@ -3493,6 +3489,10 @@
{
"value": "0040-3709",
"scheme": "issn"
+ },
+ {
+ "value": "1096-9926",
+ "scheme": "issn"
}
]
}
@@ -3620,10 +3620,10 @@
{
"type": {
"class": "http://purl.org/spar/fabio/JournalArticle",
- "defined_in": "http://purl.org/spar/fabio",
"labels": {
"en": "journal article"
- }
+ },
+ "defined_in": "http://purl.org/spar/fabio"
},
"dates": {
"publication": [
@@ -3642,10 +3642,6 @@
"entity_type": "venue",
"local_identifier": "https://w3id.org/oc/meta/br/0622015443",
"identifiers": [
- {
- "value": "1097-0215",
- "scheme": "issn"
- },
{
"value": "10.1002/(issn)1097-0215",
"scheme": "doi"
@@ -3653,6 +3649,10 @@
{
"value": "0020-7136",
"scheme": "issn"
+ },
+ {
+ "value": "1097-0215",
+ "scheme": "issn"
}
]
}
@@ -3719,10 +3719,10 @@
{
"type": {
"class": "http://purl.org/spar/fabio/JournalArticle",
- "defined_in": "http://purl.org/spar/fabio",
"labels": {
"en": "journal article"
- }
+ },
+ "defined_in": "http://purl.org/spar/fabio"
},
"dates": {
"publication": [
@@ -3741,10 +3741,6 @@
"entity_type": "venue",
"local_identifier": "https://w3id.org/oc/meta/br/06101018",
"identifiers": [
- {
- "value": "1096-9926",
- "scheme": "issn"
- },
{
"value": "10.1002/(issn)1096-9926",
"scheme": "doi"
@@ -3752,6 +3748,10 @@
{
"value": "0040-3709",
"scheme": "issn"
+ },
+ {
+ "value": "1096-9926",
+ "scheme": "issn"
}
]
}
@@ -5403,48 +5403,54 @@
"identifiers.id:0000-0002-7562-5203": [
{
"local_identifier": "https://w3id.org/oc/meta/ra/0622011040459",
- "entity_type": "person",
+ "name": "Fabio Vitali",
+ "family_name": "Vitali",
+ "given_name": "Fabio",
"identifiers": [
{
- "scheme": "orcid",
- "value": "0000-0002-7562-5203"
+ "value": "0000-0002-7562-5203",
+ "scheme": "orcid"
}
],
- "given_name": "Fabio",
- "family_name": "Vitali",
- "name": "Fabio Vitali"
+ "entity_type": "person"
}
],
"given_name:Greg": [
{
- "entity_type": "person",
+ "local_identifier": "https://w3id.org/oc/meta/ra/06150114519",
"family_name": "Kearsley",
"given_name": "Greg",
- "local_identifier": "https://w3id.org/oc/meta/ra/06150114519"
+ "entity_type": "person"
}
],
"cf.search.given_name:Greg": [
{
- "entity_type": "person",
+ "local_identifier": "https://w3id.org/oc/meta/ra/06150114519",
"family_name": "Kearsley",
"given_name": "Greg",
- "local_identifier": "https://w3id.org/oc/meta/ra/06150114519"
+ "entity_type": "person"
+ },
+ {
+ "local_identifier": "https://w3id.org/oc/meta/ra/06150115060",
+ "family_name": "O'Brien",
+ "given_name": "Gregory",
+ "entity_type": "person"
}
],
"family_name:Nakamura": [
{
- "entity_type": "person",
+ "local_identifier": "https://w3id.org/oc/meta/ra/060176",
"family_name": "Nakamura",
"given_name": "Takashi",
- "local_identifier": "https://w3id.org/oc/meta/ra/060176"
+ "entity_type": "person"
}
],
"cf.search.family_name:Nakamura": [
{
- "entity_type": "person",
+ "local_identifier": "https://w3id.org/oc/meta/ra/060176",
"family_name": "Nakamura",
"given_name": "Takashi",
- "local_identifier": "https://w3id.org/oc/meta/ra/060176"
+ "entity_type": "person"
}
],
"cf.search.given_name:Silvio,cf.search.family_name:Peroni": [
@@ -5501,14 +5507,14 @@
"identifiers.id:140": [
{
"local_identifier": "https://w3id.org/oc/meta/ra/0610116002",
- "entity_type": "organisation",
+ "name": "Emerald",
"identifiers": [
{
- "scheme": "crossref",
- "value": "140"
+ "value": "140",
+ "scheme": "crossref"
}
],
- "name": "Emerald"
+ "entity_type": "organisation"
}
],
"identifiers.scheme:crossref": [
@@ -5747,109 +5753,89 @@
"cf.search.name:Mit Press": [
{
"local_identifier": "https://w3id.org/oc/meta/ra/0610116105",
- "entity_type": "organisation",
+ "name": "Mit Press",
"identifiers": [
{
- "scheme": "crossref",
- "value": "281"
+ "value": "281",
+ "scheme": "crossref"
}
],
- "name": "Mit Press"
+ "entity_type": "organisation"
}
],
"type:conference": [
{
"local_identifier": "https://w3id.org/oc/meta/br/0607163623",
- "entity_type": "venue",
"name": "Proceedings Of The 24Th ACM/IEEE Joint Conference On Digital Libraries",
- "type": "conference"
+ "type": "conference",
+ "entity_type": "venue"
},
{
"local_identifier": "https://w3id.org/oc/meta/br/061703214020",
- "entity_type": "venue",
"name": "2009 Fourth International Conference On Cooperation And Promotion Of Information Resources In Science And Technology",
- "type": "conference"
+ "type": "conference",
+ "entity_type": "venue"
},
{
"local_identifier": "https://w3id.org/oc/meta/br/061703368436",
- "entity_type": "venue",
"name": "Proceedings Of The 14Th International Conference On World Wide Web - WWW '05",
- "type": "conference"
+ "type": "conference",
+ "entity_type": "venue"
},
{
"local_identifier": "https://w3id.org/oc/meta/br/06401936298",
- "entity_type": "venue",
"name": "Proceedings Of The 25Th International Conference On World Wide Web",
- "type": "conference"
+ "type": "conference",
+ "entity_type": "venue"
},
{
"local_identifier": "https://w3id.org/oc/meta/br/06603395157",
- "entity_type": "venue",
"name": "Proceedings Of The 8Th International Conference On Semantic Systems - I-SEMANTICS '12",
- "type": "conference"
+ "type": "conference",
+ "entity_type": "venue"
},
{
"local_identifier": "https://w3id.org/oc/meta/br/06902363257",
- "entity_type": "venue",
"name": "2021 ACM/IEEE Joint Conference On Digital Libraries (JCDL)",
- "type": "conference"
+ "type": "conference",
+ "entity_type": "venue"
}
],
"identifiers.value:2059-481X": [
{
"local_identifier": "https://w3id.org/oc/meta/br/06160186133",
- "entity_type": "venue",
- "identifiers": [
- {
- "scheme": "issn",
- "value": "2059-481X"
- },
- {
- "scheme": "openalex",
- "value": "S4210240912"
- }
- ],
"name": "Journal Of Open Humanities Data",
- "type": "journal"
- }
- ],
- "identifiers.scheme:issn": [
- {
- "local_identifier": "https://w3id.org/oc/meta/br/062502076212",
- "name": "Data Technologies And Applications",
"type": "journal",
"identifiers": [
{
- "value": "S4210171756",
- "scheme": "openalex"
- },
- {
- "value": "2514-9318",
+ "value": "2059-481X",
"scheme": "issn"
},
{
- "value": "2514-9288",
- "scheme": "issn"
+ "value": "S4210240912",
+ "scheme": "openalex"
}
],
"entity_type": "venue"
- },
+ }
+ ],
+ "identifiers.scheme:issn": [
{
"local_identifier": "https://w3id.org/oc/meta/br/06101018",
"name": "Teratology",
"type": "journal",
"identifiers": [
{
- "value": "1096-9926",
- "scheme": "issn"
+ "value": "10.1002/(issn)1096-9926",
+ "scheme": "doi"
},
{
"value": "0040-3709",
"scheme": "issn"
},
{
- "value": "10.1002/(issn)1096-9926",
- "scheme": "doi"
+ "value": "1096-9926",
+ "scheme": "issn"
}
],
"entity_type": "venue"
@@ -5899,10 +5885,6 @@
"name": "Journal Of The Medical Library Association",
"type": "journal",
"identifiers": [
- {
- "value": "S146304353",
- "scheme": "openalex"
- },
{
"value": "1536-5050",
"scheme": "issn"
@@ -5910,6 +5892,10 @@
{
"value": "1558-9439",
"scheme": "issn"
+ },
+ {
+ "value": "S146304353",
+ "scheme": "openalex"
}
],
"entity_type": "venue"
@@ -5920,11 +5906,11 @@
"type": "other",
"identifiers": [
{
- "value": "2194-5365",
+ "value": "2194-5357",
"scheme": "issn"
},
{
- "value": "2194-5357",
+ "value": "2194-5365",
"scheme": "issn"
},
{
@@ -5940,16 +5926,16 @@
"type": "journal",
"identifiers": [
{
- "value": "1521-3757",
- "scheme": "issn"
+ "value": "10.1002/(issn)1521-3757",
+ "scheme": "doi"
},
{
"value": "0044-8249",
"scheme": "issn"
},
{
- "value": "10.1002/(issn)1521-3757",
- "scheme": "doi"
+ "value": "1521-3757",
+ "scheme": "issn"
}
],
"entity_type": "venue"
@@ -5959,13 +5945,13 @@
"name": "Scientific Data",
"type": "journal",
"identifiers": [
- {
- "value": "S2607323502",
- "scheme": "openalex"
- },
{
"value": "2052-4463",
"scheme": "issn"
+ },
+ {
+ "value": "S2607323502",
+ "scheme": "openalex"
}
],
"entity_type": "venue"
@@ -5975,13 +5961,13 @@
"name": "SSRN Electronic Journal",
"type": "journal",
"identifiers": [
- {
- "value": "S4210172589",
- "scheme": "openalex"
- },
{
"value": "1556-5068",
"scheme": "issn"
+ },
+ {
+ "value": "S4210172589",
+ "scheme": "openalex"
}
],
"entity_type": "venue"
@@ -6007,13 +5993,13 @@
"name": "Publications",
"type": "journal",
"identifiers": [
- {
- "value": "S2738007992",
- "scheme": "openalex"
- },
{
"value": "2304-6775",
"scheme": "issn"
+ },
+ {
+ "value": "S2738007992",
+ "scheme": "openalex"
}
],
"entity_type": "venue"
@@ -6023,10 +6009,6 @@
"name": "Journal Of Computational Chemistry",
"type": "journal",
"identifiers": [
- {
- "value": "1096-987X",
- "scheme": "issn"
- },
{
"value": "10.1002/(issn)1096-987x",
"scheme": "doi"
@@ -6034,46 +6016,50 @@
{
"value": "0192-8651",
"scheme": "issn"
+ },
+ {
+ "value": "1096-987X",
+ "scheme": "issn"
}
],
"entity_type": "venue"
},
{
- "local_identifier": "https://w3id.org/oc/meta/br/061503030632",
- "name": "The Australian Library Journal",
+ "local_identifier": "https://w3id.org/oc/meta/br/061502934",
+ "name": "Nucleic Acids Research",
"type": "journal",
"identifiers": [
{
- "value": "0004-9670",
+ "value": "0305-1048",
"scheme": "issn"
},
{
- "value": "2201-4276",
+ "value": "1362-4962",
"scheme": "issn"
},
{
- "value": "S165931258",
+ "value": "S134668137",
"scheme": "openalex"
}
],
"entity_type": "venue"
},
{
- "local_identifier": "https://w3id.org/oc/meta/br/061502934",
- "name": "Nucleic Acids Research",
+ "local_identifier": "https://w3id.org/oc/meta/br/061503030632",
+ "name": "The Australian Library Journal",
"type": "journal",
"identifiers": [
{
- "value": "S134668137",
- "scheme": "openalex"
+ "value": "0004-9670",
+ "scheme": "issn"
},
{
- "value": "0305-1048",
+ "value": "2201-4276",
"scheme": "issn"
},
{
- "value": "1362-4962",
- "scheme": "issn"
+ "value": "S165931258",
+ "scheme": "openalex"
}
],
"entity_type": "venue"
@@ -6083,6 +6069,10 @@
"name": "The Charleston Advisor",
"type": "journal",
"identifiers": [
+ {
+ "value": "1525-4003",
+ "scheme": "issn"
+ },
{
"value": "1525-4011",
"scheme": "issn"
@@ -6090,10 +6080,6 @@
{
"value": "S82568730",
"scheme": "openalex"
- },
- {
- "value": "1525-4003",
- "scheme": "issn"
}
],
"entity_type": "venue"
@@ -6139,10 +6125,6 @@
"name": "Learned Publishing",
"type": "journal",
"identifiers": [
- {
- "value": "S29676049",
- "scheme": "openalex"
- },
{
"value": "0953-1513",
"scheme": "issn"
@@ -6150,6 +6132,10 @@
{
"value": "1741-4857",
"scheme": "issn"
+ },
+ {
+ "value": "S29676049",
+ "scheme": "openalex"
}
],
"entity_type": "venue"
@@ -6163,13 +6149,13 @@
"value": "2288-7474",
"scheme": "issn"
},
- {
- "value": "S2739153651",
- "scheme": "openalex"
- },
{
"value": "2288-8063",
"scheme": "issn"
+ },
+ {
+ "value": "S2739153651",
+ "scheme": "openalex"
}
],
"entity_type": "venue"
@@ -6180,16 +6166,16 @@
"type": "journal",
"identifiers": [
{
- "value": "1097-4571",
- "scheme": "issn"
+ "value": "10.1002/(issn)1097-4571",
+ "scheme": "doi"
},
{
"value": "0002-8231",
"scheme": "issn"
},
{
- "value": "10.1002/(issn)1097-4571",
- "scheme": "doi"
+ "value": "1097-4571",
+ "scheme": "issn"
}
],
"entity_type": "venue"
@@ -6199,6 +6185,10 @@
"name": "Journal Of Informetrics",
"type": "journal",
"identifiers": [
+ {
+ "value": "1751-1577",
+ "scheme": "issn"
+ },
{
"value": "1875-5879",
"scheme": "issn"
@@ -6206,10 +6196,6 @@
{
"value": "S205292342",
"scheme": "openalex"
- },
- {
- "value": "1751-1577",
- "scheme": "issn"
}
],
"entity_type": "venue"
@@ -6219,13 +6205,13 @@
"name": "Journal Of Clinical Anesthesia",
"type": "journal",
"identifiers": [
- {
- "value": "S155967237",
- "scheme": "openalex"
- },
{
"value": "0952-8180",
"scheme": "issn"
+ },
+ {
+ "value": "S155967237",
+ "scheme": "openalex"
}
],
"entity_type": "venue"
@@ -6236,16 +6222,16 @@
"type": "journal",
"identifiers": [
{
- "value": "1097-0215",
- "scheme": "issn"
+ "value": "10.1002/(issn)1097-0215",
+ "scheme": "doi"
},
{
"value": "0020-7136",
"scheme": "issn"
},
{
- "value": "10.1002/(issn)1097-0215",
- "scheme": "doi"
+ "value": "1097-0215",
+ "scheme": "issn"
}
],
"entity_type": "venue"
@@ -6255,13 +6241,13 @@
"name": "Humanities And Social Sciences Communications",
"type": "journal",
"identifiers": [
- {
- "value": "S4210206302",
- "scheme": "openalex"
- },
{
"value": "2662-9992",
"scheme": "issn"
+ },
+ {
+ "value": "S4210206302",
+ "scheme": "openalex"
}
],
"entity_type": "venue"
@@ -6291,13 +6277,33 @@
"name": "Quantitative Science Studies",
"type": "journal",
"identifiers": [
+ {
+ "value": "2641-3337",
+ "scheme": "issn"
+ },
{
"value": "S4210195326",
"scheme": "openalex"
+ }
+ ],
+ "entity_type": "venue"
+ },
+ {
+ "local_identifier": "https://w3id.org/oc/meta/br/062502076212",
+ "name": "Data Technologies And Applications",
+ "type": "journal",
+ "identifiers": [
+ {
+ "value": "2514-9288",
+ "scheme": "issn"
},
{
- "value": "2641-3337",
+ "value": "2514-9318",
"scheme": "issn"
+ },
+ {
+ "value": "S4210171756",
+ "scheme": "openalex"
}
],
"entity_type": "venue"
@@ -6344,11 +6350,11 @@
"type": "journal",
"identifiers": [
{
- "value": "1865-7648",
+ "value": "0341-4183",
"scheme": "issn"
},
{
- "value": "0341-4183",
+ "value": "1865-7648",
"scheme": "issn"
},
{
@@ -6363,13 +6369,13 @@
"name": "PeerJ",
"type": "journal",
"identifiers": [
- {
- "value": "S1983995261",
- "scheme": "openalex"
- },
{
"value": "2167-8359",
"scheme": "issn"
+ },
+ {
+ "value": "S1983995261",
+ "scheme": "openalex"
}
],
"entity_type": "venue"
@@ -6379,10 +6385,6 @@
"name": "Cancer",
"type": "journal",
"identifiers": [
- {
- "value": "1097-0142",
- "scheme": "issn"
- },
{
"value": "10.1002/(issn)1097-0142",
"scheme": "doi"
@@ -6390,6 +6392,10 @@
{
"value": "0008-543X",
"scheme": "issn"
+ },
+ {
+ "value": "1097-0142",
+ "scheme": "issn"
}
],
"entity_type": "venue"
@@ -6400,11 +6406,11 @@
"type": "journal",
"identifiers": [
{
- "value": "1557-7317",
+ "value": "0001-0782",
"scheme": "issn"
},
{
- "value": "0001-0782",
+ "value": "1557-7317",
"scheme": "issn"
},
{
@@ -6419,14 +6425,14 @@
"name": "Journal Of Applied Polymer Science",
"type": "journal",
"identifiers": [
- {
- "value": "0021-8995",
- "scheme": "issn"
- },
{
"value": "10.1002/(issn)1097-4628",
"scheme": "doi"
},
+ {
+ "value": "0021-8995",
+ "scheme": "issn"
+ },
{
"value": "1097-4628",
"scheme": "issn"
@@ -6440,80 +6446,80 @@
"type": "journal",
"identifiers": [
{
- "value": "1521-4095",
- "scheme": "issn"
+ "value": "10.1002/(issn)1521-4095",
+ "scheme": "doi"
},
{
"value": "0935-9648",
"scheme": "issn"
},
{
- "value": "10.1002/(issn)1521-4095",
- "scheme": "doi"
+ "value": "1521-4095",
+ "scheme": "issn"
}
],
"entity_type": "venue"
},
{
- "local_identifier": "https://w3id.org/oc/meta/br/069066063",
- "name": "Journal On Data Semantics",
+ "local_identifier": "https://w3id.org/oc/meta/br/069039310",
+ "name": "Feddes Repertorium",
"type": "journal",
"identifiers": [
{
- "value": "1861-2032",
- "scheme": "issn"
+ "value": "10.1002/(issn)1522-239x",
+ "scheme": "doi"
},
{
- "value": "1861-2067",
+ "value": "0014-8962",
"scheme": "issn"
},
{
- "value": "1867-7754",
+ "value": "0374-6577",
"scheme": "issn"
},
{
- "value": "1864-3035",
+ "value": "1522-239X",
"scheme": "issn"
- },
+ }
+ ],
+ "entity_type": "venue"
+ },
+ {
+ "local_identifier": "https://w3id.org/oc/meta/br/069066063",
+ "name": "Journal On Data Semantics",
+ "type": "journal",
+ "identifiers": [
{
- "value": "1861-2059",
+ "value": "0302-9743",
"scheme": "issn"
},
{
- "value": "0302-9743",
+ "value": "1611-3349",
"scheme": "issn"
},
{
- "value": "1611-3349",
+ "value": "1861-2032",
"scheme": "issn"
},
{
"value": "1861-2040",
"scheme": "issn"
- }
- ],
- "entity_type": "venue"
- },
- {
- "local_identifier": "https://w3id.org/oc/meta/br/069039310",
- "name": "Feddes Repertorium",
- "type": "journal",
- "identifiers": [
+ },
{
- "value": "0014-8962",
+ "value": "1861-2059",
"scheme": "issn"
},
{
- "value": "1522-239X",
+ "value": "1861-2067",
"scheme": "issn"
},
{
- "value": "0374-6577",
+ "value": "1864-3035",
"scheme": "issn"
},
{
- "value": "10.1002/(issn)1522-239x",
- "scheme": "doi"
+ "value": "1867-7754",
+ "scheme": "issn"
}
],
"entity_type": "venue"
@@ -6522,35 +6528,35 @@
"cf.search.name:Digital Libraries": [
{
"local_identifier": "https://w3id.org/oc/meta/br/0607163623",
- "entity_type": "venue",
"name": "Proceedings Of The 24Th ACM/IEEE Joint Conference On Digital Libraries",
- "type": "conference"
+ "type": "conference",
+ "entity_type": "venue"
},
{
"local_identifier": "https://w3id.org/oc/meta/br/06160781188",
- "entity_type": "venue",
+ "name": "International Journal On Digital Libraries",
+ "type": "journal",
"identifiers": [
{
- "scheme": "issn",
- "value": "1432-1300"
+ "value": "1432-1300",
+ "scheme": "issn"
},
{
- "scheme": "issn",
- "value": "1432-5012"
+ "value": "1432-5012",
+ "scheme": "issn"
},
{
- "scheme": "openalex",
- "value": "S110615584"
+ "value": "S110615584",
+ "scheme": "openalex"
}
],
- "name": "International Journal On Digital Libraries",
- "type": "journal"
+ "entity_type": "venue"
},
{
"local_identifier": "https://w3id.org/oc/meta/br/06902363257",
- "entity_type": "venue",
"name": "2021 ACM/IEEE Joint Conference On Digital Libraries (JCDL)",
- "type": "conference"
+ "type": "conference",
+ "entity_type": "venue"
}
]
}
diff --git a/test/data/index_isbn.json b/test/data/index_isbn.json
new file mode 100644
index 0000000..52efbd8
--- /dev/null
+++ b/test/data/index_isbn.json
@@ -0,0 +1,114 @@
+{
+ "retrieved_at": "2026-09-29T13:38:24.769502+00:00",
+ "metadata": [
+ {
+ "url": "https://api.opencitations.net/meta/v1/metadata/isbn:9789663601922",
+ "results": [
+ {
+ "id": "doi:10.15407/akademperiodyka.192.304 isbn:9789663601922 openalex:W2790273689 omid:br/06101786021",
+ "title": "Coastal Zone Resources Management",
+ "author": "Ivanov, V.A. [omid:ra/06105318565]; Igumnova, E.M. [omid:ra/06105318566]; Timchenko, I.E. [omid:ra/06105318567]",
+ "pub_date": "2012-05-19",
+ "issue": "",
+ "volume": "",
+ "venue": "",
+ "type": "book",
+ "page": "",
+ "publisher": "National Academy Of Sciences Of Ukraine (Co. Ltd Ukrinformnauka) [crossref:6225 omid:ra/0610116288]",
+ "editor": ""
+ }
+ ]
+ },
+ {
+ "url": "https://api.opencitations.net/meta/v1/metadata/omid:br/061202333124",
+ "results": [
+ {
+ "id": "doi:10.31519/conferencearticle_5b1b9384252a73.81999055 openalex:W2593131457 omid:br/061202333124",
+ "title": "Mapping Biochemical Fields In The Upper Layer Of The Black Sea By The Adaptive Balance Of Causes Method",
+ "author": "Lazarchuk, Inga [omid:ra/061206986868]; Lazarchuk, Inga [omid:ra/061206986869]; Timchenko, Igor [omid:ra/061206986870]; Timchenko, Igor [omid:ra/061206986871]",
+ "pub_date": "2017-10-11",
+ "issue": "",
+ "volume": "",
+ "venue": "Proceedings Of International Conference \"Managinag Risks To Coastal Regions And Communities In A Changinag World\" (EMECS'11 - SeaCoasts XXVI) [omid:br/061202334121]",
+ "type": "proceedings article",
+ "page": "",
+ "publisher": "Academus Publishing [crossref:15171 omid:ra/0670114706]",
+ "editor": ""
+ }
+ ]
+ },
+ {
+ "url": "https://api.opencitations.net/meta/v1/metadata/omid:br/06603737264",
+ "results": [
+ {
+ "id": "doi:10.1357/002224090784984678 openalex:W2077769416 omid:br/06603737264",
+ "title": "A Nitrogen-Based Model Of Plankton Dynamics In The Oceanic Mixed Layer",
+ "author": "Fasham, M. J. R. [omid:ra/066010366029]; Ducklow, H. W. [omid:ra/066010366030]; McKelvie, S. M. [omid:ra/066010366031]",
+ "pub_date": "1990-08-01",
+ "issue": "3",
+ "volume": "48",
+ "venue": "Journal Of Marine Research [issn:0022-2402 issn:1543-9542 openalex:S166958622 omid:br/064064740]",
+ "type": "journal article",
+ "page": "591-639",
+ "publisher": "Journal Of Marine Research/Yale [crossref:270 omid:ra/0680114484]",
+ "editor": ""
+ }
+ ]
+ },
+ {
+ "url": "https://api.opencitations.net/meta/v1/metadata/omid:br/061502169014",
+ "results": [
+ {
+ "id": "doi:10.1016/j.ecolecon.2008.01.017 openalex:W2079791368 omid:br/061502169014",
+ "title": "How To Be An Ecological Economist",
+ "author": "Faber, Malte [omid:ra/061506480601]",
+ "pub_date": "2008-05",
+ "issue": "1",
+ "volume": "66",
+ "venue": "Ecological Economics [issn:0921-8009 openalex:S136211407 omid:br/069053430]",
+ "type": "journal article",
+ "page": "1-7",
+ "publisher": "Elsevier Bv [crossref:78 omid:ra/0610116009]",
+ "editor": ""
+ }
+ ]
+ }
+ ],
+ "references": {
+ "url": "https://api.opencitations.net/index/v2/references/omid:br/06101786021",
+ "selected_results": [
+ {
+ "oci": "06101786021-06603737264",
+ "citing": "omid:br/06101786021 doi:10.15407/akademperiodyka.192.304 isbn:9789663601922 openalex:W2790273689",
+ "cited": "omid:br/06603737264 doi:10.1357/002224090784984678 openalex:W2077769416",
+ "creation": "2012-05-19",
+ "timespan": "P21Y9M18D",
+ "journal_sc": "no",
+ "author_sc": "no"
+ },
+ {
+ "oci": "06101786021-061502169014",
+ "citing": "omid:br/06101786021 doi:10.15407/akademperiodyka.192.304 isbn:9789663601922 openalex:W2790273689",
+ "cited": "omid:br/061502169014 doi:10.1016/j.ecolecon.2008.01.017 openalex:W2079791368",
+ "creation": "2012-05-19",
+ "timespan": "P4Y0M",
+ "journal_sc": "no",
+ "author_sc": "no"
+ }
+ ]
+ },
+ "citations": {
+ "url": "https://api.opencitations.net/index/v2/citations/omid:br/06101786021",
+ "selected_results": [
+ {
+ "oci": "061202333124-06101786021",
+ "citing": "omid:br/061202333124 doi:10.31519/conferencearticle_5b1b9384252a73.81999055 openalex:W2593131457",
+ "cited": "omid:br/06101786021 doi:10.15407/akademperiodyka.192.304 isbn:9789663601922 openalex:W2790273689",
+ "creation": "2017-10-11",
+ "timespan": "P5Y4M22D",
+ "journal_sc": "no",
+ "author_sc": "no"
+ }
+ ]
+ }
+}
diff --git a/test/data/index_issn.json b/test/data/index_issn.json
new file mode 100644
index 0000000..04392cc
--- /dev/null
+++ b/test/data/index_issn.json
@@ -0,0 +1,159 @@
+{
+ "retrieved_at": "2026-09-29T15:23:49.872614+00:00",
+ "metadata": [
+ {
+ "url": "https://api.opencitations.net/meta/v1/metadata/issn:1096-987X",
+ "results": [
+ {
+ "id": "doi:10.1002/(issn)1096-987x issn:0192-8651 issn:1096-987X openalex:S21117631 omid:br/0615019585",
+ "title": "Journal Of Computational Chemistry",
+ "author": "",
+ "pub_date": "",
+ "issue": "",
+ "volume": "",
+ "venue": "",
+ "type": "journal",
+ "page": "",
+ "publisher": "Wiley [crossref:311 omid:ra/0610116001]",
+ "editor": ""
+ }
+ ]
+ },
+ {
+ "url": "https://api.opencitations.net/meta/v1/metadata/omid:br/06190415414",
+ "results": [
+ {
+ "id": "doi:10.1080/07391102.2017.1386592 openalex:W2761138796 pmid:28978251 omid:br/06190415414",
+ "title": "Intermolecular Interactions Between DNA And Methamphetamine, Amphetamine, Ecstasy And Their Major Metabolites",
+ "author": "Reis, Arthur F.V.F. [omid:ra/061901185326]; Pereira, Igor L. G. [orcid:0000-0002-8022-3612 omid:ra/06160113859]; Neto, Abel F.G. [omid:ra/061901185327]; Santos, Alberdan S. [omid:ra/061901185328]; Kuca, Kamil [omid:ra/061901185329]; Nepovimova, Eugenie [orcid:0000-0003-0281-246X omid:ra/068012488831]; Neto, Antonio M.J.C. [omid:ra/061901185330]",
+ "pub_date": "2017-10-23",
+ "issue": "12",
+ "volume": "36",
+ "venue": "Journal Of Biomolecular Structure And Dynamics [issn:0739-1102 issn:1538-0254 openalex:S178711970 omid:br/061708427]",
+ "type": "journal article",
+ "page": "3047-3057",
+ "publisher": "Informa Uk Limited [crossref:301 omid:ra/0610116005]",
+ "editor": ""
+ }
+ ]
+ },
+ {
+ "url": "https://api.opencitations.net/meta/v1/metadata/omid:br/061701295110",
+ "results": [
+ {
+ "id": "doi:10.1088/0953-4075/47/14/143001 openalex:W2042280112 omid:br/061701295110",
+ "title": "Understanding The Structure And Dynamic Of Odorants In The Gas Phase Using A Combination Of Microwave Spectroscopy And Quantum Chemical Calculations",
+ "author": "Mouhib, Halima [orcid:0000-0001-5031-3468 omid:ra/069014588]",
+ "pub_date": "2014-07-04",
+ "issue": "14",
+ "volume": "47",
+ "venue": "Journal Of Physics B: Atomic, Molecular And Optical Physics [issn:0953-4075 issn:1361-6455 openalex:S108417319 omid:br/0616036311]",
+ "type": "journal article",
+ "page": "143001",
+ "publisher": "Iop Publishing [crossref:266 omid:ra/0610116040]",
+ "editor": ""
+ }
+ ]
+ },
+ {
+ "url": "https://api.opencitations.net/meta/v1/metadata/omid:br/06101680950",
+ "results": [
+ {
+ "id": "doi:10.1484/eer-eb issn:2295-9254 issn:2295-9262 openalex:S4210239944 omid:br/06101680950",
+ "title": "",
+ "author": "Essary, Kirk [omid:ra/06035094624]; Van Gent, Jacqueline [omid:ra/06035094625]; Adams, Tracy [omid:ra/06035094626]; Jamroziak, Emilia [omid:ra/06035094627]; Meyer, Matthias [omid:ra/06035094628]; Ricciardelli, Fabrizio [omid:ra/06035094629]; Ruys, Juanita Feros [omid:ra/06035094630]; Sigurðsson, Jón Viðar [omid:ra/06035094631]; Terpstra, Nicholas [omid:ra/06035094632]",
+ "pub_date": "",
+ "issue": "",
+ "volume": "",
+ "venue": "",
+ "type": "",
+ "page": "",
+ "publisher": "Brepols Publishers Nv [crossref:7597 omid:ra/0610116091]",
+ "editor": ""
+ }
+ ]
+ },
+ {
+ "url": "https://api.opencitations.net/meta/v1/metadata/omid:br/061602440477",
+ "results": [
+ {
+ "id": "doi:10.1057/9780230298125_8 openalex:W2339586113 omid:br/061602440477",
+ "title": "Francis Bacon’s Bi-literal Cipher And The Materiality Of Early Modern Diplomatic Writing",
+ "author": "Stewart, Alan [omid:ra/061607098301]",
+ "pub_date": "2011",
+ "issue": "",
+ "volume": "",
+ "venue": "Diplomacy And Early Modern Culture [doi:10.1057/9780230298125 isbn:9780230298125 isbn:9781349316267 openalex:W599936931 omid:br/061602440482]",
+ "type": "book chapter",
+ "page": "120-137",
+ "publisher": "Springer Science And Business Media Llc [crossref:297 omid:ra/0610116006]",
+ "editor": "Adams, Robyn [omid:ra/061607098305]; Cox, Rosanna [omid:ra/061607098306]"
+ }
+ ]
+ },
+ {
+ "url": "https://api.opencitations.net/meta/v1/metadata/omid:br/06130803068",
+ "results": [
+ {
+ "id": "doi:10.1080/0268117x.2021.1926651 openalex:W3180010455 omid:br/06130803068",
+ "title": "Addressing Audiences Abroad: Cultural And Public Diplomacy In Seventeenth-Century Europe",
+ "author": "Lamal, Nina [orcid:0000-0002-7460-5163 omid:ra/0613061148]; Van Gelder, Klaas [orcid:0000-0002-9250-629X omid:ra/061302457354]",
+ "pub_date": "2021-05-04",
+ "issue": "3",
+ "volume": "36",
+ "venue": "The Seventeenth Century [issn:0268-117X issn:2050-4616 openalex:S4210210779 omid:br/06130803749]",
+ "type": "journal article",
+ "page": "367-387",
+ "publisher": "Informa Uk Limited [crossref:301 omid:ra/0610116005]",
+ "editor": ""
+ }
+ ]
+ }
+ ],
+ "citations": {
+ "url": "https://api.opencitations.net/index/v2/citations/omid:br/0615019585?limit=2",
+ "selected_results": [
+ {
+ "oci": "06190415414-0615019585",
+ "citing": "omid:br/06190415414 doi:10.1080/07391102.2017.1386592 openalex:W2761138796 pmid:28978251",
+ "cited": "omid:br/0615019585 doi:10.1002/(issn)1096-987x issn:0192-8651 issn:1096-987X openalex:S21117631",
+ "creation": "2017-10-23",
+ "timespan": "",
+ "journal_sc": "no",
+ "author_sc": "no"
+ },
+ {
+ "oci": "061701295110-0615019585",
+ "citing": "omid:br/061701295110 doi:10.1088/0953-4075/47/14/143001 openalex:W2042280112",
+ "cited": "omid:br/0615019585 doi:10.1002/(issn)1096-987x issn:0192-8651 issn:1096-987X openalex:S21117631",
+ "creation": "2014-07-04",
+ "timespan": "",
+ "journal_sc": "no",
+ "author_sc": "no"
+ }
+ ]
+ },
+ "references": {
+ "url": "https://api.opencitations.net/index/v2/references/omid:br/06101680950",
+ "selected_results": [
+ {
+ "oci": "06101680950-061602440477",
+ "citing": "omid:br/06101680950 doi:10.1484/eer-eb issn:2295-9254 issn:2295-9262 openalex:S4210239944",
+ "cited": "omid:br/061602440477 doi:10.1057/9780230298125_8 openalex:W2339586113",
+ "creation": "",
+ "timespan": "",
+ "journal_sc": "no",
+ "author_sc": "no"
+ },
+ {
+ "oci": "06101680950-06130803068",
+ "citing": "omid:br/06101680950 doi:10.1484/eer-eb issn:2295-9254 issn:2295-9262 openalex:S4210239944",
+ "cited": "omid:br/06130803068 doi:10.1080/0268117x.2021.1926651 openalex:W3180010455",
+ "creation": "",
+ "timespan": "",
+ "journal_sc": "no",
+ "author_sc": "no"
+ }
+ ]
+ }
+}
diff --git a/test/qlever-index-data/index_subset.nt b/test/qlever-data/index_subset.nt
similarity index 93%
rename from test/qlever-index-data/index_subset.nt
rename to test/qlever-data/index_subset.nt
index 7126ef0..3a4c441 100644
--- a/test/qlever-index-data/index_subset.nt
+++ b/test/qlever-data/index_subset.nt
@@ -215,3 +215,17 @@
.
.
.
+ .
+ .
+ .
+ .
+ .
+ .
+ .
+ .
+ .
+ .
+ .
+ .
+ .
+ .
diff --git a/test/virtuoso-meta-data/meta_subset.nq b/test/qlever-data/meta_subset.nq
similarity index 99%
rename from test/virtuoso-meta-data/meta_subset.nq
rename to test/qlever-data/meta_subset.nq
index 8a4b66d..3a963cf 100644
--- a/test/virtuoso-meta-data/meta_subset.nq
+++ b/test/qlever-data/meta_subset.nq
@@ -34648,3 +34648,80 @@
.
.
"Zenodo" .
+ "2012-05-19"^^ .
+ .
+ .
+ .
+ "2017-10-11"^^ .
+ .
+ .
+ "2008-05"^^ .
+ .
+ .
+ "1990-08-01"^^ .
+ .
+ .
+ .
+ "10.1016/j.ecolecon.2008.01.017"^^ .
+ .
+ "10.1357/002224090784984678"^^ .
+ .
+ "10.15407/akademperiodyka.192.304"^^ .
+