Class AccJsonProperty

java.lang.Object
org.aksw.jenax.io.json.accumulator.AccJsonBase
org.aksw.jenax.io.json.accumulator.AccJsonProperty
All Implemented Interfaces:
AccJson, AccJsonEdge

public class AccJsonProperty extends AccJsonBase implements AccJsonEdge
Accumulator for the values of an (objectId, propertyId) pair.
  • Field Details

    • matchFieldId

      protected org.apache.jena.graph.Node matchFieldId
    • isForward

      protected boolean isForward
    • jsonKey

      protected org.apache.jena.sparql.path.P_Path0 jsonKey
      The property that is emitted by this edge accumulator if values are encountered.
    • currentTarget

      protected org.apache.jena.graph.Node currentTarget
    • targetAcc

      protected AccJsonNode targetAcc
    • skipOutputStartedHere

      protected boolean skipOutputStartedHere
    • seenTargetCount

      protected long seenTargetCount
    • isSingle

      protected boolean isSingle
      If 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()
      Specified by:
      getPath in interface AccJson
    • isSingle

      public boolean isSingle()
    • getJsonKey

      public org.apache.jena.sparql.path.P_Path0 getJsonKey()
      Specified by:
      getJsonKey in interface AccJsonEdge
    • getMatchFieldId

      public org.apache.jena.graph.Node getMatchFieldId()
      Specified by:
      getMatchFieldId in interface AccJsonEdge
    • isForward

      public boolean isForward()
      Specified by:
      isForward in interface AccJsonEdge
    • 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:
      begin in interface AccJson
      Overrides:
      begin in class AccJsonBase
      Parameters:
      node - The source node to which the next incoming edge(s) will connect to
      context - The context which holds the JSON serializers
      skipOutput - 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:
      transition in interface AccJson
      Throws:
      IOException
    • end

      public void end(AccContextRdf context) throws IOException
      Description copied from interface: AccJson
      End the accumulator's current node
      Specified by:
      end in interface AccJson
      Overrides:
      end in class AccJsonBase
      Throws:
      IOException
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • acceptContribution

      public void acceptContribution(RdfElement item, AccContextRdf context)
      Description copied from interface: AccJson
      For 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:
      acceptContribution in interface AccJson