Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update bf_work.py - added SPARQL for bf:genreForm #242

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kallimathios
Copy link
Collaborator

added SPARQL for bf:genreForm to line 83, under subject definition

added SPARQL for bf:genreForm to line 83
@@ -79,6 +79,14 @@
<{bf_work}> bf:subject ?subject_node .
OPTIONAL {{
?subject_node rdfs:label ?subject .

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The genre SPARQL query template should be it's own variable instead being a part of the subject variable otherwise it is an invalid SPARQL query, i.e.

genre = """PREFIX bf: <http://id.loc.gov/ontologies/bibframe/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?genre
WHERE {{
    <{bf_work}> a bf:Work .
    <{bf_work}> bf:genreForm ?genre_node .
    OPTIONAL {{
        ?genre_node rdfs:label ?genre .
    }}
}}"""

You'll then need to add the new genre template to the following places:

  • build.py's transformers dict, something like genre: _subjects,
  • map.py's BF_TO_FOLIO_MAP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants