Skip to content

Commit

Permalink
fix python compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanhb committed Jul 4, 2024
1 parent a0a3fee commit c779fb1
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions metaapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,20 +84,17 @@ def generate_id_search(ids: str) -> Tuple[str]:
#omid_values.append(f"{{ BIND(<https://w3id.org/oc/meta/{literal_value}> AS ?res) }}")
omid_values.append("{{ BIND(<https://w3id.org/oc/meta/"+literal_value+"> AS ?res) }}")
elif scheme in {'doi', 'issn', 'isbn', 'openalex', 'pmid', 'pmcid', 'url', 'wikidata', 'wikipedia'}:
other_values.append(f'''
other_values.append('''
{{
?identifier literal:hasLiteralValue "{literal_value}";
?identifier literal:hasLiteralValue '''+literal_value+''';
datacite:usesIdentifierScheme datacite:{scheme};
^datacite:hasIdentifier ?res.
?res a fabio:Expression.
}}
''')

if omid_values:
id_searches.append(f'''
?res a fabio:Expression.
{" UNION ".join(omid_values)}
''')
id_searches.append('''?res a fabio:Expression.'''+" UNION ".join(omid_values)} )

if other_values:
id_searches.append(" UNION ".join(other_values))
Expand Down

0 comments on commit c779fb1

Please sign in to comment.