Class CustomFormGraph
java.lang.Object
it.uniroma2.art.semanticturkey.customform.CustomForm
it.uniroma2.art.semanticturkey.customform.CustomFormGraph
-
Nested Class Summary
Nested classes/interfaces inherited from class it.uniroma2.art.semanticturkey.customform.CustomForm
CustomForm.Types
-
Field Summary
Fields inherited from class it.uniroma2.art.semanticturkey.customform.CustomForm
PREFIX
-
Method Summary
Modifier and TypeMethodDescriptionexecutePearl
(it.uniroma2.art.coda.core.CODACore codaCore, Map<String, Object> userPromptMap, StandardForm stdForm, SessionFormData sessionData, FormContextData ctxData) Fills a CAS with the value specified in the given userPromptMap, then executes CODA with the CAS, generates the triples and returns them.static InputStream
getEntryPointPlaceholder
(it.uniroma2.art.coda.core.CODACore codaCore) Returns the placeholder of the entry point of the graph section.getForm
(it.uniroma2.art.coda.core.CODACore codaCore) Returns a Collection ofUserPromptStruct
that is used to render a formCollection<it.uniroma2.art.coda.pearl.model.GraphElement>
getGraphSection
(it.uniroma2.art.coda.core.CODACore codaCore) getGraphSectionAsString
(it.uniroma2.art.coda.core.CODACore codaCore, boolean optional) Returns the serialization of the graph section of the PEARL in the current CustomForm.getRelevantFormPlaceholders
(it.uniroma2.art.coda.core.CODACore codaCore) Returns a map placeholderId-userPrompt used in the node section to identify userPrompt fields.boolean
isResourceCreationDelegated
(it.uniroma2.art.coda.core.CODACore codaCore) Tells if the CustomForm is delegated to create the resource.Methods inherited from class it.uniroma2.art.semanticturkey.customform.CustomForm
asCustomFormGraph, asCustomFormNode, equals, getDescription, getId, getLevel, getName, getRef, getType, isTypeGraph, isTypeNode, save, setDescription, setId, setLevel, setName, setRef
-
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 ofUserPromptStruct
that is used to render a form- Specified by:
getForm
in classCustomForm
- Parameters:
codaCore
- an instance ofCODACore
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 theOPTIONAL {}
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 keywordOPTIONAL
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.UnassignableFeaturePathExceptionFills 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 formcodaCore
- an instance of CODACore already initialized- Returns:
- Throws:
CODAException
it.uniroma2.art.coda.exception.UnassignableFeaturePathException
it.uniroma2.art.coda.exception.ProjectionRuleModelNotSet
-
getAnnotationPearlStream
-