Skip to content

Commit

Permalink
meta api sparql endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanhb committed Jul 4, 2024
1 parent 5819fea commit 3013a7d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
3 changes: 2 additions & 1 deletion indexapi_v2.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2023, Silvio Peroni <[email protected]>, Ivan Heibi <[email protected]>
# Copyright (c) 2023, Silvio Peroni <[email protected]>
#
# 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
Expand Down Expand Up @@ -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)
Expand Down
16 changes: 8 additions & 8 deletions meta_v1.hf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#version Version 1.1.1 (2022-12-22)
#contacts [[email protected]](mailto:[email protected])
#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

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
} GROUP BY ?id ?title ?type ?issue ?volume ?venue ?pub_date ?page

0 comments on commit 3013a7d

Please sign in to comment.