Skip to content

Commit

Permalink
#1319 - Generic support for PubAnnotation
Browse files Browse the repository at this point in the history
- Changed field names in JSON to match PubAnnotation conventions
  • Loading branch information
reckart committed Mar 4, 2019
1 parent c9be549 commit 8d9eeaa
Show file tree
Hide file tree
Showing 3 changed files with 2,670 additions and 2,662 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,21 @@
*/
package org.dkpro.core.io.pubannotation.internal.model;

// "attributes": [
// {"id": "T1", "key": "lala", "value": "lolo"},
import com.fasterxml.jackson.annotation.JsonProperty;

// "attributions":[
// {"subj":string:denotation-id, "pred":string:attribute-name,"obj":string:attribute-value}
// ]
public class PAAttribute
{
@JsonProperty("subj")
private String subject;
private String key;
private String value;

@JsonProperty("pred")
private String predicate;

@JsonProperty("obj")
private String object;

public PAAttribute()
{
Expand All @@ -34,8 +41,8 @@ public PAAttribute()
public PAAttribute(String aSubject, String aKey, String aValue)
{
subject = aSubject;
key = aKey;
value = aValue;
predicate = aKey;
object = aValue;
}

public String getSubject()
Expand All @@ -48,23 +55,23 @@ public void setSubject(String aSubject)
subject = aSubject;
}

public String getKey()
public String getPredicate()
{
return key;
return predicate;
}

public void setKey(String aKey)
public void setPredicate(String aKey)
{
key = aKey;
predicate = aKey;
}

public String getValue()
public String getObject()
{
return value;
return object;
}

public void setValue(String aValue)
public void setObject(String aValue)
{
value = aValue;
object = aValue;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* @see <a href="http://www.pubannotation.org/docs/annotation-format/">PubAnnotation documentation</a>
*/
@JsonPropertyOrder({ "target", "sourcedb", "sourceid", "text", "project", "denotations",
"relations", "modifications", "namespaces" })
"relations", "attributions", "modifications", "namespaces" })
public class PADocument
{
@JsonInclude(Include.NON_NULL)
Expand All @@ -55,6 +55,7 @@ public class PADocument
@JsonInclude(Include.NON_EMPTY)
private List<PARelation> relations = new ArrayList<>();

@JsonProperty("attributions")
@JsonInclude(Include.NON_EMPTY)
private List<PAAttribute> attributes = new ArrayList<>();

Expand Down
Loading

0 comments on commit 8d9eeaa

Please sign in to comment.