Commit 2fe92eab authored by Ian Dennis Miller's avatar Ian Dennis Miller

add author and year to appearances

parent 44740d4c
<div class="card" id="{{ id }}" about="#{{ appearance_id }}">
<p class="appearance">{{ appearance }}</p>
<p class="appearance">{{ appearance_authors }}. ({{ appearance_year }}). {{ appearance_title }}</p>
<div class="quote">{{ quote }}</div>
<div class="search">
<ul>
......
......@@ -9,7 +9,7 @@ from jinja2 import Environment, PackageLoader, select_autoescape
sparql = """
SELECT ?quote ?authors ?year ?appearance ?fact_id ?appearance_id ?source_id ?title
SELECT ?quote ?authors ?year ?appearance_title ?appearance_authors ?appearance_year ?fact_id ?appearance_id ?source_id ?title
WHERE {{
?fact_id rdf:type <https://projects.sisrlab.com/idm/visfact/raw/master/thesis.rdf#Claim> .
?fact_id thesis:quote ?quote .
......@@ -18,7 +18,9 @@ SELECT ?quote ?authors ?year ?appearance ?fact_id ?appearance_id ?source_id ?tit
?source_id dc:authors ?authors .
?source_id dc:title ?title .
?source_id dc:year ?year .
?appearance_id dc:title ?appearance .
?appearance_id dc:title ?appearance_title .
?appearance_id dc:authors ?appearance_authors .
?appearance_id dc:year ?appearance_year .
}}
"""
......@@ -49,7 +51,8 @@ class VisFact:
articles = {}
facts = {}
for row in self.g.query(sparql):
(quote, authors, year, appearance, fact_id, appearance_id, source_id, title) = row
(quote, authors, year, appearance_title, appearance_authors, appearance_year, fact_id,
appearance_id, source_id, title) = row
# make fact_id sortable
m = re.match(r'ub(\d+?)bL(\d+?)C.+', fact_id)
......@@ -77,7 +80,9 @@ class VisFact:
facts[fact_id] = {
'id': "{0}".format(fact_id),
'quote': quote,
'appearance': appearance,
'appearance_authors': appearance_authors,
'appearance_year': appearance_year,
'appearance_title': appearance_title,
'appearance_id': appearance_id,
'sources': [source],
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment