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

Issue 3: Add tags to articles #22

Merged
merged 1 commit into from
Apr 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,10 @@ public class Document extends Common {
@PropertySource(template = "document/receipt", predicate = "http://www.w3.org/2000/01/rdf-schema#label")
private List<String> receipts;

@Indexed(type = "whole_strings")
@PropertySource(template = "document/tag", predicate = "http://purl.obolibrary.org/obo/ARG_0000015")
private List<String> tags;

public Document() {

}
Expand Down Expand Up @@ -1179,4 +1183,12 @@ public void setReceipts(List<String> receipts) {
this.receipts = receipts;
}

public List<String> getTags() {
return tags;
}

public void setTags(List<String> tags) {
this.tags = tags;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@ public class Document extends AbstractNestedDocument {

private String modTime;

private List<String> tags;

@JsonProperty("class")
private String clazz;

Expand Down Expand Up @@ -771,6 +773,14 @@ public void setModTime(String modTime) {
this.modTime = modTime;
}

public List<String> getTags() {
return tags;
}

public void setTags(List<String> tags) {
this.tags = tags;
}

public String getClazz() {
return clazz;
}
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/defaults/displayViews.yml
Original file line number Diff line number Diff line change
Expand Up @@ -981,6 +981,9 @@
- name: date/time value
template: "defaults/displayViews/documents/other/dateTimeValue.html"
field: dateTimeValue
- name: tags
template: "defaults/displayViews/documents/other/tags.html"
field: tags

- name: Relationships
types:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{{#if tags}}
<ul class="list-unstyled">
{{#each tags}}
<li>
<span>{{this}}</span>
</li>
{{/each}}
</ul>
{{/if}}
7 changes: 7 additions & 0 deletions src/main/resources/templates/sparql/document/tag.sparql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
PREFIX obo: <http://purl.obolibrary.org/obo/>

CONSTRUCT {
<{{uri}}> obo:ARG_0000015 ?tag .
} WHERE {
<{{uri}}> obo:ARG_0000015 ?tag .
}