diff --git a/indexapi_v2.py b/indexapi_v2.py index beed861..ee41aaa 100644 --- a/indexapi_v2.py +++ b/indexapi_v2.py @@ -1,6 +1,6 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# Copyright (c) 2023, Silvio Peroni , Ivan Heibi +# Copyright (c) 2023, Silvio Peroni # # Permission to use, copy, modify, and/or distribute this software for any purpose # with or without fee is hereby granted, provided that the above copyright notice @@ -134,6 +134,7 @@ def __call_tp_for_citations(omid_l): } GROUP BY ?cited """ try: + headers={"Accept": "application/sparql-results+json", "Content-Type": "application/sparql-query"} response = post(sparql_endpoint, headers=headers, data=sparql_query, timeout=45) if response.status_code == 200: r = loads(response.text) diff --git a/meta_v1.hf b/meta_v1.hf index 362022c..d2bb234 100644 --- a/meta_v1.hf +++ b/meta_v1.hf @@ -6,7 +6,7 @@ #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://127.0.0.1/meta/sparql +#endpoint http://127.0.0.1:8990/sparql #method post #addon metaapi @@ -214,9 +214,9 @@ WHERE { ?res frbr:partOf+ ?resVolume. ?resVolume a fabio:JournalVolume; fabio:hasSequenceIdentifier ?volume. - } + } } GROUP BY ?res ?title ?author_ ?editor_ ?publisher_ ?type ?issue ?volume ?pub_date ?page ?venueName ?venueMetaid ORDER BY DESC(?totAuthor) DESC(?totEditor) DESC(?totPublisher) - } + } BIND(CONCAT(?ids, IF(STR(?ids) != "", " ", ""), "omid:br/", STRAFTER(STR(?res), "/br/")) AS ?id) BIND(IF(STR(?venue_ids) != "", CONCAT(" [", ?venue_ids, " ", ?venueMetaid, "]"), "") AS ?venueIdentifiers) BIND(CONCAT(?venueName, ?venueIdentifiers) AS ?venue) @@ -458,9 +458,9 @@ WHERE { ?res frbr:partOf+ ?resVolume. ?resVolume a fabio:JournalVolume; fabio:hasSequenceIdentifier ?volume. - } + } } GROUP BY ?res ?title ?author_ ?editor_ ?publisher_ ?type ?issue ?volume ?pub_date ?page ?venueName ?venueMetaid ORDER BY DESC(?totAuthor) DESC(?totEditor) DESC(?totPublisher) - } + } BIND(CONCAT(?ids, IF(STR(?ids) != "", " ", ""), "omid:br/", STRAFTER(STR(?res), "/br/")) AS ?id) BIND(IF(STR(?venue_ids) != "", CONCAT(" [", ?venue_ids, " ", ?venueMetaid, "]"), "") AS ?venueIdentifiers) BIND(CONCAT(?venueName, ?venueIdentifiers) AS ?venue) @@ -676,10 +676,10 @@ WHERE { ?res frbr:partOf+ ?resVolume. ?resVolume a fabio:JournalVolume; fabio:hasSequenceIdentifier ?volume. - } + } } GROUP BY ?res ?title ?author_ ?editor_ ?publisher_ ?type ?issue ?volume ?pub_date ?page ?venueName ?venueMetaid ORDER BY DESC(?totAuthor) DESC(?totEditor) DESC(?totPublisher) - } + } BIND(CONCAT(?ids, IF(STR(?ids) != "", " ", ""), "omid:br/", STRAFTER(STR(?res), "/br/")) AS ?id) BIND(IF(STR(?venue_ids) != "", CONCAT(" [", ?venue_ids, " ", ?venueMetaid, "]"), "") AS ?venueIdentifiers) BIND(CONCAT(?venueName, ?venueIdentifiers) AS ?venue) -} GROUP BY ?id ?title ?type ?issue ?volume ?venue ?pub_date ?page \ No newline at end of file +} GROUP BY ?id ?title ?type ?issue ?volume ?venue ?pub_date ?page