Package hydra.query
Class TriplePattern
- java.lang.Object
-
- hydra.query.TriplePattern
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<TriplePattern>
public class TriplePattern extends java.lang.Object implements java.io.Serializable, java.lang.Comparable<TriplePattern>
A subject/predicate/object pattern- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description NodeobjectThe object of the patternstatic NameOBJECTName of thehydra.query.TriplePattern.objectfield.PathpredicateThe predicate (property) of the patternstatic NamePREDICATEName of thehydra.query.TriplePattern.predicatefield.NodesubjectThe subject of the patternstatic NameSUBJECTName of thehydra.query.TriplePattern.subjectfield.static NameTYPE_Name of thehydra.query.TriplePatterntype.
-
Constructor Summary
Constructors Constructor Description TriplePattern(Node subject, Path predicate, Node object)Constructs an immutableTriplePattern.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(TriplePattern other)booleanequals(java.lang.Object other)inthashCode()TriplePatternwithObject(Node object)Returns a copy of thisTriplePatternwithobjectreplaced.TriplePatternwithPredicate(Path predicate)Returns a copy of thisTriplePatternwithpredicatereplaced.TriplePatternwithSubject(Node subject)Returns a copy of thisTriplePatternwithsubjectreplaced.
-
-
-
Field Detail
-
TYPE_
public static final Name TYPE_
Name of thehydra.query.TriplePatterntype.
-
SUBJECT
public static final Name SUBJECT
Name of thehydra.query.TriplePattern.subjectfield.
-
PREDICATE
public static final Name PREDICATE
Name of thehydra.query.TriplePattern.predicatefield.
-
OBJECT
public static final Name OBJECT
Name of thehydra.query.TriplePattern.objectfield.
-
subject
public final Node subject
The subject of the pattern
-
predicate
public final Path predicate
The predicate (property) of the pattern
-
object
public final Node object
The object of the pattern
-
-
Constructor Detail
-
TriplePattern
public TriplePattern(Node subject, Path predicate, Node object)
Constructs an immutableTriplePattern.- Parameters:
subject- The subject of the patternpredicate- The predicate (property) of the patternobject- The object of the pattern
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
compareTo
public int compareTo(TriplePattern other)
- Specified by:
compareToin interfacejava.lang.Comparable<TriplePattern>
-
withSubject
public TriplePattern withSubject(Node subject)
Returns a copy of thisTriplePatternwithsubjectreplaced.
-
withPredicate
public TriplePattern withPredicate(Path predicate)
Returns a copy of thisTriplePatternwithpredicatereplaced.
-
withObject
public TriplePattern withObject(Node object)
Returns a copy of thisTriplePatternwithobjectreplaced.
-
-