java.lang.Object
it.uniroma2.art.semanticturkey.services.STServiceAdapter
it.uniroma2.art.semanticturkey.services.core.Sheet2RDF
All Implemented Interfaces:
NewerNewStyleService, STService

@STService public class Sheet2RDF extends STServiceAdapter
  • Constructor Details

    • Sheet2RDF

      public Sheet2RDF()
  • Method Details

    • uploadSpreadsheet

      @STServiceOperation(method=POST) @Read public void uploadSpreadsheet(org.springframework.web.multipart.MultipartFile file, @Optional(defaultValue="columnNumericIndex") it.uniroma2.art.sheet2rdf.utils.FsNamingStrategy fsNamingStrategy) throws IOException, it.uniroma2.art.sheet2rdf.exception.GenericSheet2RDFException
      Uploads an excel file into a server directory
      Parameters:
      file -
      fsNamingStrategy -
      Throws:
      IOException
      it.uniroma2.art.sheet2rdf.exception.GenericSheet2RDFException
    • uploadDBInfo

      @STServiceOperation(method=POST) @Read public void uploadDBInfo(String db_base_url, String db_name, List<String> db_tableList, String db_user, String db_password, it.uniroma2.art.sheet2rdf.db.AvailableDBDriverName.Values db_driverName, @Optional(defaultValue="columnNumericIndex") it.uniroma2.art.sheet2rdf.utils.FsNamingStrategy fsNamingStrategy) throws it.uniroma2.art.sheet2rdf.exception.GenericSheet2RDFException
      Uploads an excel file into a server directory
      Parameters:
      db_base_url -
      db_name -
      db_tableList -
      db_user -
      db_password -
      fsNamingStrategy -
      Throws:
      IOException
      it.uniroma2.art.sheet2rdf.exception.GenericSheet2RDFException
    • getSupportedDBDrivers

      @STServiceOperation @Read public List<String> getSupportedDBDrivers()
    • listSheetNames

      @STServiceOperation public List<String> listSheetNames()
    • getHeaders

      @STServiceOperation @Read public com.fasterxml.jackson.databind.JsonNode getHeaders() throws DOMException
      Returns all the headers (mapping structs) of all the available sheets
      Returns:
      Throws:
      DOMException
    • getSheetHeaders

      @STServiceOperation @Read public com.fasterxml.jackson.databind.JsonNode getSheetHeaders(String sheetName) throws DOMException
      Returns an array list containing the headers of the given sheet
      Returns:
      Throws:
      DOMException
    • getHeaderFromId

      @STServiceOperation @Read public com.fasterxml.jackson.databind.JsonNode getHeaderFromId(String sheetName, String headerId)
      Returns information about the header structure with the given id
      Parameters:
      headerId -
      Returns:
      Throws:
      DOMException
    • ignoreHeader

      @STServiceOperation(method=POST) public void ignoreHeader(String sheetName, String headerId, boolean ignore)
    • addSimpleGraphApplicationToHeader

      @STServiceOperation(method=POST) public void addSimpleGraphApplicationToHeader(String sheetName, String headerId, org.eclipse.rdf4j.model.IRI property, String nodeId, @Optional org.eclipse.rdf4j.model.IRI type)
      Creates and adds a new graph application to an header
      Parameters:
      headerId - id of the header
      property - property of the graph application
      nodeId - node id of the graph application
      type - the optional rdf:type of the node
    • addAdvancedGraphApplicationToHeader

      @STServiceOperation(method=POST) public void addAdvancedGraphApplicationToHeader(String sheetName, String headerId, String graphPattern, List<String> nodeIds, Map<String,String> prefixMapping, @Optional org.eclipse.rdf4j.model.IRI defaultPredicate)
    • updateSimpleGraphApplication

      @STServiceOperation(method=POST) public void updateSimpleGraphApplication(String sheetName, String headerId, String graphId, org.eclipse.rdf4j.model.IRI property, String nodeId, @Optional org.eclipse.rdf4j.model.IRI type)
      Updates an existing graph application of an header
      Parameters:
      headerId - id of the header
      graphId - id of the existing graph application
      property - property of the graph application
      nodeId - node id of the graph application
      type - the optional rdf:type of the node
    • updateAdvancedGraphApplication

      @STServiceOperation(method=POST) public void updateAdvancedGraphApplication(String sheetName, String headerId, String graphId, String graphPattern, List<String> nodeIds, Map<String,String> prefixMapping, @Optional org.eclipse.rdf4j.model.IRI defaultPredicate)
      Updates an existing advanced graph application of an header
      Parameters:
      headerId - id of the header
      graphId - id of the existing graph application
      graphPattern - updated graph pattern
      nodeIds - updated list of referenced node ids
      defaultPredicate - predicate for the fallback of the pred placeholder in the pattern
    • updateGraphApplicationDelete

      @STServiceOperation(method=POST) public void updateGraphApplicationDelete(String sheetName, String headerId, String graphId, boolean delete)
      Parameters:
      headerId -
      graphId -
      delete -
    • removeGraphApplicationFromHeader

      @STServiceOperation(method=POST) public void removeGraphApplicationFromHeader(String sheetName, String headerId, String graphId)
      Removes a graph application from an header
      Parameters:
      headerId - id of the header
      graphId - id of the existing graph application
    • isNodeIdAlreadyUsed

      @STServiceOperation @Read public Boolean isNodeIdAlreadyUsed(String sheetName, String nodeId)
      Returns true if the given node id is already in use. Check useful when creating/updating a node
      Parameters:
      nodeId -
      Returns:
    • addNodeToHeader

      @Read @STServiceOperation(method=POST) public void addNodeToHeader(String sheetName, String headerId, String nodeId, it.uniroma2.art.coda.interfaces.annotations.converters.RDFCapabilityType converterCapability, String converterContract, @Optional String converterDatatypeUri, @Optional String converterLanguage, @Optional Map<String,String> converterParams, @Optional String defaultNamespace, @Optional @JsonSerialized it.uniroma2.art.sheet2rdf.header.NodeMemoization memoization, @Optional @JsonSerialized it.uniroma2.art.sheet2rdf.header.NodeSanitization sanitization)
      Creates and adds a node to a header. Note: This service does not perform any check on node ID collision. This check should be done separately via isNodeIdAlreadyUsed(String, String) Note 2: The creation of a node doesn't imply that it is used in a graph application. This needs to be done separately (with add/update Simple/Advanced GraphApplicationToHeader}
      Parameters:
      headerId -
      nodeId -
      converterCapability -
      converterContract -
      converterDatatypeUri -
      converterLanguage -
      converterParams -
      memoize -
    • updateNodeInHeader

      @Read @STServiceOperation(method=POST) public void updateNodeInHeader(String sheetName, String headerId, String nodeId, it.uniroma2.art.coda.interfaces.annotations.converters.RDFCapabilityType converterCapability, String converterContract, @Optional String converterDatatypeUri, @Optional String converterLanguage, @Optional Map<String,String> converterParams, @Optional String defaultNamespace, @Optional @JsonSerialized it.uniroma2.art.sheet2rdf.header.NodeMemoization memoization, @Optional @JsonSerialized it.uniroma2.art.sheet2rdf.header.NodeSanitization sanitization)
    • updateRuleSanitization

      @STServiceOperation(method=POST) public void updateRuleSanitization(String sheetName, @Optional @JsonSerialized it.uniroma2.art.sheet2rdf.header.NodeSanitization sanitization)
    • renameNodeId

      @STServiceOperation(method=POST) public void renameNodeId(String sheetName, String headerId, String nodeId, String newNodeId)
    • removeNodeFromHeader

      @STServiceOperation(method=POST) public void removeNodeFromHeader(String sheetName, String headerId, String nodeId)
      Removes a node from an header. If the node is used/referenced by a graph application, updates the graph application as well.
      Parameters:
      headerId - id of the header
      nodeId - id of the existing node
    • replicateMultipleHeader

      @STServiceOperation(method=POST) public void replicateMultipleHeader(String sheetName, String headerId)
      Given the header with the headerId, replicate its configuration for all the other headers with the same name
      Parameters:
      headerId -
    • updateSubjectHeader

      @Read @STServiceOperation(method=POST) public void updateSubjectHeader(String sheetName, String headerId, String converterContract, @Optional Map<String,String> converterParams, @Optional org.eclipse.rdf4j.model.IRI type, @Optional String defaultNamespace, @Optional(defaultValue="[]") @JsonSerialized List<Pair<org.eclipse.rdf4j.model.IRI,org.eclipse.rdf4j.model.Value>> additionalPredObjs, @Optional @JsonSerialized it.uniroma2.art.sheet2rdf.header.NodeMemoization memoization, @Optional @JsonSerialized it.uniroma2.art.sheet2rdf.header.NodeSanitization sanitization)
      Update the subject header
      Parameters:
      headerId -
      type -
      converterContract -
      converterParams -
      memoize -
    • getTablePreview

      @STServiceOperation public com.fasterxml.jackson.databind.JsonNode getTablePreview(String sheetName, int maxRows) throws it.uniroma2.art.sheet2rdf.exception.NotExistingSheetException
      Returns a preview of the sheet containing the first maxRows rows
      Parameters:
      maxRows -
      Returns:
      Throws:
      it.uniroma2.art.sheet2rdf.exception.NotExistingSheetException
    • getPearl

      @STServiceOperation public com.fasterxml.jackson.databind.JsonNode getPearl(String sheetName) throws IOException
      Returns the PEARL code generated by Excel2RDF
      Returns:
      Throws:
      IOException
    • savePearl

      @STServiceOperation(method=POST) public void savePearl(String sheetName, String pearlCode) throws IOException
      Saves/updates the PEARL code eventually edited by user
      Throws:
      FileNotFoundException
      IOException
    • validateGraphPattern

      @STServiceOperation(method=POST) public com.fasterxml.jackson.databind.JsonNode validateGraphPattern(String pearlCode, @Optional(defaultValue="true") boolean rulesShouldExists)
      It validated the PEARL rule and returns the used prefixes in the graph section
    • uploadPearl

      @STServiceOperation(method=POST) public com.fasterxml.jackson.databind.JsonNode uploadPearl(String sheetName, org.springframework.web.multipart.MultipartFile file) throws IOException
      Uploads a pearl file into a server directory and returns the code
      Parameters:
      file -
      Returns:
      Throws:
      IOException
    • getTriplesPreview

      @STServiceOperation @Read public com.fasterxml.jackson.databind.JsonNode getTriplesPreview(String sheetName, int maxTableRows) throws org.apache.uima.UIMAException, it.uniroma2.art.coda.exception.parserexception.PRParserException, it.uniroma2.art.coda.provisioning.ComponentProvisioningException, it.uniroma2.art.coda.exception.ConverterException, it.uniroma2.art.coda.exception.DependencyException, it.uniroma2.art.coda.exception.RDFModelNotSetException, it.uniroma2.art.coda.exception.ProjectionRuleModelNotSet, it.uniroma2.art.coda.exception.UnassignableFeaturePathException, it.uniroma2.art.sheet2rdf.exception.NotExistingSheetException, it.uniroma2.art.coda.exception.ValueNotPresentDueToConfigurationException
      Returns triples generated by Sheet2RDF XML Response structure: data -> triple -> subject, predicate, object. This means that inside data element will be some triple element containing subject predicate and object element
      Parameters:
      maxTableRows - max number of table rows to consider in the triples preview (e.g. returns the triples generated considering the first 10 rows)
      Returns:
      Throws:
      org.eclipse.rdf4j.query.QueryEvaluationException
      org.eclipse.rdf4j.query.MalformedQueryException
      org.eclipse.rdf4j.query.UnsupportedQueryLanguageException
      it.uniroma2.art.coda.exception.ConverterException
      it.uniroma2.art.coda.provisioning.ComponentProvisioningException
      it.uniroma2.art.coda.exception.parserexception.PRParserException
      org.apache.uima.UIMAException
      it.uniroma2.art.coda.exception.DependencyException
      it.uniroma2.art.coda.exception.RDFModelNotSetException
      it.uniroma2.art.coda.exception.UnassignableFeaturePathException
      it.uniroma2.art.coda.exception.ProjectionRuleModelNotSet
      Exception
      it.uniroma2.art.sheet2rdf.exception.NotExistingSheetException
      it.uniroma2.art.coda.exception.ValueNotPresentDueToConfigurationException
    • addTriples

      @STServiceOperation @Write public void addTriples(String sheetName)
      Simply adds the triples generated to the model
    • exportTriples

      @STServiceOperation public void exportTriples(jakarta.servlet.http.HttpServletResponse oRes, String sheetName, org.eclipse.rdf4j.rio.RDFFormat outputFormat) throws IOException
      Throws:
      IOException
    • getPrefixMappings

    • exportSheetStatus

      @STServiceOperation public void exportSheetStatus(jakarta.servlet.http.HttpServletResponse oRes, String sheetName) throws IOException
      Serializes a JSON file that represents the status of the conversion.
      Parameters:
      oRes -
      Throws:
      IOException
      com.fasterxml.jackson.databind.JsonMappingException
      com.fasterxml.jackson.core.JsonGenerationException
    • exportGlobalStatus

      @STServiceOperation public void exportGlobalStatus(jakarta.servlet.http.HttpServletResponse oRes) throws IOException
      Throws:
      IOException
    • importSheetStatus

      @Read @STServiceOperation(method=POST) public void importSheetStatus(org.springframework.web.multipart.MultipartFile statusFile, String sheetName) throws IOException, it.uniroma2.art.sheet2rdf.exception.InvalidWizardStatusException
      Parameters:
      statusFile -
      Throws:
      it.uniroma2.art.sheet2rdf.exception.InvalidWizardStatusException - Load a JSON file that represents the status of the conversion and restore the mapping struct
      IOException
    • importGlobalStatus

      @Read @STServiceOperation(method=POST) public void importGlobalStatus(org.springframework.web.multipart.MultipartFile statusFile) throws IOException, it.uniroma2.art.sheet2rdf.exception.InvalidWizardStatusException
      Throws:
      IOException
      it.uniroma2.art.sheet2rdf.exception.InvalidWizardStatusException
    • getDefaultAdvancedGraphApplicationConfigurations

      @STServiceOperation public Collection<Reference> getDefaultAdvancedGraphApplicationConfigurations()
      Returns the default configurations references stored directly in the Sheet2RDF classpath
      Returns:
    • getConfiguration

      @STServiceOperation public Configuration getConfiguration(String identifier) throws STPropertyAccessException, IOException
      Returns the serialization of the configuration identified through the given identifier.
      Parameters:
      identifier -
      Returns:
      Throws:
      STPropertyAccessException
      IOException
    • closeSession

      @STServiceOperation public void closeSession()