public class Triple extends Object implements Comparable<Triple>
| Modifier and Type | Field and Description |
|---|---|
static int |
annotation |
static int |
object |
static int |
predicate |
static int |
subject |
| Constructor and Description |
|---|
Triple(String subject,
String predicate,
String object)
Constructor: Create new triple from subject/predicate/object strings (annotation will be empty)
|
Triple(String subject,
String predicate,
String object,
String annotation)
Constructor: Create new triple from subject/predicate/object/annotation strings
|
| Modifier and Type | Method and Description |
|---|---|
void |
applyPrefixes(LinkedList<Prefix> pre)
Apply Prefixes to triple - replaces IRIs with prefixes
|
int |
compareTo(Triple t)
Compare this triple with another triple
used for sorting, lexicographic order, ignores annotations
|
boolean |
equals(Object o)
Checks if this triple is equal to another triple
|
String |
getAnnotation() |
String |
getByIndex(int index)
Get subject/predicate/object/annotation by integer index
|
BigInteger |
getHash() |
String |
getObject() |
String |
getPredicate() |
String |
getSubject() |
boolean |
isSPOequal(String[] triple)
Are subject, predicate and object equal (don't check the annotation)?
|
boolean |
isSPOequal(Triple t)
Are subject, predicate and object equal (don't check the annotation)?
|
boolean |
isValid()
Checks if tripel is well-formed
|
void |
resolvePrefixes(LinkedList<Prefix> pre)
Resolve Prefixes in triple - replaces prefixes with IRIs
|
void |
setAnnotation(String annotation) |
void |
setByIndex(int index,
String value)
Set subject/predicate/object/annotation by integer index
|
void |
setHash(BigInteger hash) |
void |
setObject(String object) |
void |
setPredicate(String predicate) |
void |
setSubject(String subject) |
String |
toString()
Converts triple to a string (used for printing and debugging)
|
public static final int subject
public static final int predicate
public static final int object
public static final int annotation
public Triple(String subject, String predicate, String object)
subject - predicate - object - public String getSubject()
public void setSubject(String subject)
public String getPredicate()
public void setPredicate(String predicate)
public String getObject()
public void setObject(String object)
public String getAnnotation()
public void setAnnotation(String annotation)
public String getByIndex(int index)
index - 0=subject, 1=predicate, 2=object, 3=annotationpublic void setByIndex(int index,
String value)
index - value - public BigInteger getHash()
public void setHash(BigInteger hash)
public boolean isSPOequal(Triple t)
t - Triple which is compared with this triplepublic boolean isSPOequal(String[] triple)
triple - Triple (specified as string array) which is compared with this triplepublic boolean isValid()
throws Exception
Exception - if triple is malformedpublic void resolvePrefixes(LinkedList<Prefix> pre)
pre - public void applyPrefixes(LinkedList<Prefix> pre)
pre - public String toString()
public int compareTo(Triple t)
compareTo in interface Comparable<Triple>t - triple to compare withCopyright © 2018. All rights reserved.