Skip to content

Commit

Permalink
feat(models): add graph to person model
Browse files Browse the repository at this point in the history
  • Loading branch information
b1rger committed Jan 10, 2025
1 parent e4f428d commit 7b0b018
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 2 additions & 0 deletions pfp_api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ class Entity(BaseModel): ...


class Person(Entity):
person: str = None
label: str = Field(..., example="Arthur Schnitzler")
graph: str = None
14 changes: 8 additions & 6 deletions pfp_api/templates/persons.j2
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
PREFIX crm: <http://www.cidoc-crm.org/cidoc-crm/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?person ?label
SELECT ?person ?label ?graph
WHERE {
?person a crm:E21_Person ;
rdfs:label ?label .
{% if label %}
FILTER CONTAINS(STR(?label), "{{ label }}")
{% endif %}
GRAPH ?graph {
?person a crm:E21_Person ;
rdfs:label ?label .
{% if label %}
FILTER CONTAINS(STR(?label), "{{ label }}")
{% endif %}
}
}

0 comments on commit 7b0b018

Please sign in to comment.