Class CustomFormGraph

java.lang.Object
it.uniroma2.art.semanticturkey.customform.CustomForm
it.uniroma2.art.semanticturkey.customform.CustomFormGraph

public class CustomFormGraph extends CustomForm
  • Method Details

    • getForm

      public Collection<UserPromptStruct> getForm(it.uniroma2.art.coda.core.CODACore codaCore) throws it.uniroma2.art.coda.exception.parserexception.PRParserException
      Returns a Collection of UserPromptStruct that is used to render a form
      Specified by:
      getForm in class CustomForm
      Parameters:
      codaCore - an instance of CODACore already initialized
      Returns:
      Throws:
      it.uniroma2.art.coda.exception.parserexception.PRParserException
    • isResourceCreationDelegated

      public boolean isResourceCreationDelegated(it.uniroma2.art.coda.core.CODACore codaCore) throws CODAException
      Tells if the CustomForm is delegated to create the resource. This happens if the reserved node resource is defined in the pearl as: - resource uri userPrompt/foo . //resource generated from a value provided by user - resource uri(coda:...) . //resource generated without using an input feature (e.g. with randIdGen)
      Parameters:
      codaCore -
      Returns:
      Throws:
      it.uniroma2.art.coda.exception.parserexception.PRParserException
      CODAException
    • getRelevantFormPlaceholders

      public Map<String,String> getRelevantFormPlaceholders(it.uniroma2.art.coda.core.CODACore codaCore) throws it.uniroma2.art.coda.exception.parserexception.PRParserException
      Returns a map placeholderId-userPrompt used in the node section to identify userPrompt fields. Returns only those placeholder not used as argument of some converter (as for langString argument)
      Parameters:
      codaCore -
      Returns:
      Throws:
      it.uniroma2.art.coda.exception.parserexception.PRParserException
    • getEntryPointPlaceholder

      public String getEntryPointPlaceholder(it.uniroma2.art.coda.core.CODACore codaCore) throws it.uniroma2.art.coda.exception.parserexception.PRParserException
      Returns the placeholder of the entry point of the graph section. Such placeholder is useful for binding a (reified) resource with the variable in the SPARQL query to - delete a CF value - retrieve a form-based preview The placeholder is: - $resource if used in the graph section - the first subject node of the first non-optional graph element Returns null if none of the two cases above are met (note that the pearl of a CF should never allow such case, otherwise it would lead to error)
      Parameters:
      codaCore -
      Returns:
      Throws:
      it.uniroma2.art.coda.exception.parserexception.PRParserException
      it.uniroma2.art.coda.exception.RDFModelNotSetException
    • getGraphSection

      public Collection<it.uniroma2.art.coda.pearl.model.GraphElement> getGraphSection(it.uniroma2.art.coda.core.CODACore codaCore) throws it.uniroma2.art.coda.exception.parserexception.PRParserException
      Throws:
      it.uniroma2.art.coda.exception.parserexception.PRParserException
    • getGraphSectionAsString

      public String getGraphSectionAsString(it.uniroma2.art.coda.core.CODACore codaCore, boolean optional) throws it.uniroma2.art.coda.exception.parserexception.PRParserException
      Returns the serialization of the graph section of the PEARL in the current CustomForm.
      Parameters:
      codaCore -
      optional - specify if the OPTIONAL {} has to be serialized. Note that if is set to false, it doesn't mean that the content of the OPTIONAL is omitted, but only that the keyword OPTIONAL and the curly braces {} are omitted.
      Returns:
      Throws:
      it.uniroma2.art.coda.exception.parserexception.PRParserException
      it.uniroma2.art.coda.exception.RDFModelNotSetException
    • executePearl

      public UpdateTripleSet executePearl(it.uniroma2.art.coda.core.CODACore codaCore, Map<String,Object> userPromptMap, StandardForm stdForm, SessionFormData sessionData, FormContextData ctxData) throws CODAException, it.uniroma2.art.coda.exception.ProjectionRuleModelNotSet, it.uniroma2.art.coda.exception.UnassignableFeaturePathException
      Fills a CAS with the value specified in the given userPromptMap, then executes CODA with the CAS, generates the triples and returns them.
      Parameters:
      userPromptMap - map containing userPrompt-value pairs, where userPrompt is a feature name (the same indicated in the pearl userPrompt/...) and value is the value given by user.
      stdForm - contains the value provided/generated from the standard form
      codaCore - an instance of CODACore already initialized
      Returns:
      Throws:
      CODAException
      it.uniroma2.art.coda.exception.UnassignableFeaturePathException
      it.uniroma2.art.coda.exception.ProjectionRuleModelNotSet
    • getAnnotationPearlStream

      public static InputStream getAnnotationPearlStream()