Class AccJsonProperty
java.lang.Object
org.aksw.jenax.io.json.accumulator.AccJsonBase
org.aksw.jenax.io.json.accumulator.AccJsonProperty
- All Implemented Interfaces:
AccJson,AccJsonEdge
Accumulator for the values of an (objectId, propertyId) pair.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.apache.jena.graph.Nodeprotected booleanprotected booleanIf true then no array is created.protected org.apache.jena.sparql.path.P_Path0The property that is emitted by this edge accumulator if values are encountered.protected org.apache.jena.graph.Nodeprotected longprotected booleanprotected AccJsonNodeFields inherited from class org.aksw.jenax.io.json.accumulator.AccJsonBase
currentSourceNode, hasBegun, oldSourceNode, parent, skipOutput, value -
Constructor Summary
ConstructorsConstructorDescriptionAccJsonProperty(org.apache.jena.sparql.path.P_Path0 jsonKey, org.apache.jena.graph.Node matchFieldId, boolean isForward, AccJsonNode targetAcc, boolean isSingle) -
Method Summary
Modifier and TypeMethodDescriptionvoidacceptContribution(RdfElement item, AccContextRdf context) For materialization: Whenever end() is called on a state with materialization enabled, then it passes its accumulated value to the parent using this method.voidbegin(org.apache.jena.graph.Node node, AccContextRdf context, boolean skipOutput) Sets the source node which subsequent triples must match in addition to the fieldId.voidend(AccContextRdf context) End the accumulator's current nodeorg.apache.jena.sparql.path.P_Path0org.apache.jena.graph.Nodeorg.aksw.commons.path.json.PathJsongetPath()booleanbooleanisSingle()toString()transition(org.apache.jena.graph.Triple input, AccContextRdf context) Accepts a triple if source and field id match that of the current stateMethods inherited from class org.aksw.jenax.io.json.accumulator.AccJsonBase
ensureBegun, getInternalValue, getParent, getValue, hasBegun, setParent
-
Field Details
-
matchFieldId
protected org.apache.jena.graph.Node matchFieldId -
isForward
protected boolean isForward -
jsonKey
protected org.apache.jena.sparql.path.P_Path0 jsonKeyThe property that is emitted by this edge accumulator if values are encountered. -
currentTarget
protected org.apache.jena.graph.Node currentTarget -
targetAcc
-
skipOutputStartedHere
protected boolean skipOutputStartedHere -
seenTargetCount
protected long seenTargetCount -
isSingle
protected boolean isSingleIf true then no array is created. Any item after the first raises an error event.
-
-
Constructor Details
-
AccJsonProperty
public AccJsonProperty(org.apache.jena.sparql.path.P_Path0 jsonKey, org.apache.jena.graph.Node matchFieldId, boolean isForward, AccJsonNode targetAcc, boolean isSingle)
-
-
Method Details
-
getPath
public org.aksw.commons.path.json.PathJson getPath() -
isSingle
public boolean isSingle() -
getJsonKey
public org.apache.jena.sparql.path.P_Path0 getJsonKey()- Specified by:
getJsonKeyin interfaceAccJsonEdge
-
getMatchFieldId
public org.apache.jena.graph.Node getMatchFieldId()- Specified by:
getMatchFieldIdin interfaceAccJsonEdge
-
isForward
public boolean isForward()- Specified by:
isForwardin interfaceAccJsonEdge
-
begin
public void begin(org.apache.jena.graph.Node node, AccContextRdf context, boolean skipOutput) throws IOException Sets the source node which subsequent triples must match in addition to the fieldId. This method should be called by the owner of the edge such as AccJsonObject.- Specified by:
beginin interfaceAccJson- Overrides:
beginin classAccJsonBase- Parameters:
node- The source node to which the next incoming edge(s) will connect tocontext- The context which holds the JSON serializersskipOutput- When output should be disabled (used e.g. to skip over lists of items where just one was expected)- Throws:
IOException
-
transition
public AccJson transition(org.apache.jena.graph.Triple input, AccContextRdf context) throws IOException Accepts a triple if source and field id match that of the current state- Specified by:
transitionin interfaceAccJson- Throws:
IOException
-
end
Description copied from interface:AccJsonEnd the accumulator's current node- Specified by:
endin interfaceAccJson- Overrides:
endin classAccJsonBase- Throws:
IOException
-
toString
-
acceptContribution
Description copied from interface:AccJsonFor materialization: Whenever end() is called on a state with materialization enabled, then it passes its accumulated value to the parent using this method.- Specified by:
acceptContributionin interfaceAccJson
-