CreateRequest

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.wscreation.createrequest
Class CreateRequest

    java.lang.Object
      com.wscreation.createrequest.CreateRequest

    public class CreateRequest

extends java.lang.Object

Class used to create a SPARQL query

Author:
  WOLLBRETT

Field Summary
`(package private) java.util.Vector<AssociationWithoutAttributs>` | `awa`
`private boolean` | `DEBUG`
`(package private) FindOnePath` | `findOnePath`
`(package private) java.util.Vector<com.hp.hpl.jena.rdf.model.Resource>` | `inheritanceRelationships`
`(package private) com.hp.hpl.jena.rdf.model.Resource` | `input`
`(package private) com.hp.hpl.jena.rdf.model.Resource` | `inputAnnot`
`(package private) com.hp.hpl.jena.rdf.model.Resource` | `inputTable`
`(package private) int` | `inputType`
`(package private) com.hp.hpl.jena.rdf.model.Resource` | `lastPKWithoutAtt`
`(package private) com.hp.hpl.jena.rdf.model.Resource` | `lastRelation`
`(package private) java.lang.String` | `mappingPath`
`(package private) com.hp.hpl.jena.rdf.model.Resource` | `output`
`(package private) com.hp.hpl.jena.rdf.model.Resource` | `outputAnnot`
`(package private) int` | `OUTPUTISMULTIPLEPK`
`(package private) int` | `OUTPUTISSIMPLEPK`
`(package private) com.hp.hpl.jena.rdf.model.Resource` | `outputTable`
`(package private) int` | `outputType`
`(package private) java.util.Vector<PathNode>` | `path`
`(package private) java.util.Vector<java.lang.String>` | `request`
`(package private) java.util.Vector<PathNode>` | `shortestPathNodes`
`(package private) boolean` | `union`

Constructor Summary

`CreateRequest(java.lang.String mappingPath, java.util.Vector<PathNode> path, com.hp.hpl.jena.rdf.model.Resource input, com.hp.hpl.jena.rdf.model.Resource output, com.hp.hpl.jena.rdf.model.Resource inputAnnot, com.hp.hpl.jena.rdf.model.Resource outputAnnot, FindOnePath findOnePath)`

Method Summary
`private void` | `addNamespaces()` declare all needed namespaces at the beginning of the query
`private java.util.Vector<BlocRequete>` | `buildBlocRequeteVector(java.util.Vector<java.lang.String> prebuildRequest)` create a bloc like query(each bloc correspond to a subquery linking input to output).
`private java.util.Vector<java.lang.String>` | `buildRequest()` create a SPARQL query from a shortest path vector created with the findShortestPath() method
`private void` | `deleteDoubleNull()`
`private java.util.Vector<PathNode>` | `detectHeritageRelationships(java.util.Vector<PathNode> pathnode)` create a vector containing all inheritance relationship
`void` | `findShortestPath()` find the shortest path. recursive method calling findshortestPath(Resource, Vector, Resource) for each detected inheritance relationship
`java.util.Vector<PathNode>` | `findShortestPath(com.hp.hpl.jena.rdf.model.Resource input, java.util.Vector<com.hp.hpl.jena.rdf.model.Resource> alreadyDetectedHeritage, com.hp.hpl.jena.rdf.model.Resource parent)` retrieve the shortest path corresponding to each detecting inheritance relationship
`private boolean` | `firstRelationHasMultiplePrimaryKey()` detect if the first relation contains primary key composed to multiple attributs true => multiple false => unique
`private int` | `getFirstRelation()` retrieve information about the first relation
`private com.hp.hpl.jena.rdf.model.Resource` | `getInputTable(com.hp.hpl.jena.rdf.model.Resource inputColumn)` retrieve the table containing the input column
`private int` | `getLastRelation()` retrieve information about the relation relation
`private void` | `getOutputTable()` search the output table
`java.util.Vector<java.lang.String>` | `getRequestPath()`
`java.util.Vector<PathNode>` | `getShortestPathNodes()`
`private java.util.Vector<PathNode>` | `invertShortestPathNodes(java.util.Vector<PathNode> spn)` invert all elements of the vector containing the shortest path
`private java.util.Vector<java.lang.String>` | `manageRequest(java.util.Vector<BlocRequete> blocRequeteVector)` manage the different bloc of the query previously detecting in order to have a structured SPARQL query
`private void` | `namespaceToPrefix()` change each namespace of the query to its correponding prefix.
`private void` | `postmodification()` postmodify query in case of UNION and delete association table orientation (+ and - at beginning of a line)
`private java.util.Vector<java.lang.String>` | `preBuildRequest()`
`private void` | `simpleQuery()`
`private void` | `verifyNull()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### path

    java.util.Vector<PathNode> path

### mappingPath

    java.lang.String mappingPath

### input

    com.hp.hpl.jena.rdf.model.Resource input

### output

    com.hp.hpl.jena.rdf.model.Resource output

### outputTable

    com.hp.hpl.jena.rdf.model.Resource outputTable

### findOnePath

    FindOnePath findOnePath

### inheritanceRelationships

    java.util.Vector<com.hp.hpl.jena.rdf.model.Resource> inheritanceRelationships

### shortestPathNodes

    java.util.Vector<PathNode> shortestPathNodes

### request

    java.util.Vector<java.lang.String> request

### awa

    java.util.Vector<AssociationWithoutAttributs> awa

### inputAnnot

    com.hp.hpl.jena.rdf.model.Resource inputAnnot

### outputAnnot

    com.hp.hpl.jena.rdf.model.Resource outputAnnot

### union

    boolean union

### OUTPUTISSIMPLEPK

    int OUTPUTISSIMPLEPK

### OUTPUTISMULTIPLEPK

    int OUTPUTISMULTIPLEPK

### outputType

    int outputType

### inputType

    int inputType

### lastPKWithoutAtt

    com.hp.hpl.jena.rdf.model.Resource lastPKWithoutAtt

### lastRelation

    com.hp.hpl.jena.rdf.model.Resource lastRelation

### inputTable

    com.hp.hpl.jena.rdf.model.Resource inputTable

### DEBUG

    private boolean DEBUG

Constructor Detail

### CreateRequest

    public CreateRequest(java.lang.String mappingPath,
                         java.util.Vector<PathNode> path,
                         com.hp.hpl.jena.rdf.model.Resource input,
                         com.hp.hpl.jena.rdf.model.Resource output,
                         com.hp.hpl.jena.rdf.model.Resource inputAnnot,
                         com.hp.hpl.jena.rdf.model.Resource outputAnnot,
                         FindOnePath findOnePath)

Method Detail

### getShortestPathNodes

    public java.util.Vector<PathNode> getShortestPathNodes()

### getRequestPath

    public java.util.Vector<java.lang.String> getRequestPath()

### findShortestPath

    public void findShortestPath()

  find the shortest path. recursive method calling findshortestPath(Resource, Vector, Resource) for each detected inheritance relationship

### findShortestPath

    public java.util.Vector<PathNode> findShortestPath(com.hp.hpl.jena.rdf.model.Resource input,
                                                       java.util.Vector<com.hp.hpl.jena.rdf.model.Resource> alreadyDetectedHeritage,
                                                       com.hp.hpl.jena.rdf.model.Resource parent)

  retrieve the shortest path corresponding to each detecting inheritance relationship

  Parameters:
    `input` - input Resource
    `alreadyDetectedHeritage` -
    `parent;` - parent of the detected inheritance relationship
  Returns:
    Vector; a vector containing already detected nodes of the shortest path

### getFirstRelation

    private int getFirstRelation()

  retrieve information about the first relation

  Returns:
    int corresponding to the type of the first relation.

### getLastRelation

    private int getLastRelation()

  retrieve information about the relation relation

  Returns:
    int corresponding to the type of the last relation.

### firstRelationHasMultiplePrimaryKey

    private boolean firstRelationHasMultiplePrimaryKey()

  detect if the first relation contains primary key composed to multiple attributs true => multiple false => unique

  Returns:
    boolean

### getInputTable

    private com.hp.hpl.jena.rdf.model.Resource getInputTable(com.hp.hpl.jena.rdf.model.Resource inputColumn)

  retrieve the table containing the input column

  Parameters:
    `inputColumn` -
  Returns:
    Resource input column

### getOutputTable

    private void getOutputTable()

  search the output table

### detectHeritageRelationships

    private java.util.Vector<PathNode> detectHeritageRelationships(java.util.Vector<PathNode> pathnode)

  create a vector containing all inheritance relationship

  Parameters:
    `pathnode` -
  Returns:
    Vector

### buildRequest

    private java.util.Vector<java.lang.String> buildRequest()

  create a SPARQL query from a shortest path vector created with the findShortestPath() method

  Returns:
    Vector each String is a line of the SPARQL query

### simpleQuery

    private void simpleQuery()

### manageRequest

    private java.util.Vector<java.lang.String> manageRequest(java.util.Vector<BlocRequete> blocRequeteVector)

  manage the different bloc of the query previously detecting in order to have a structured SPARQL query

  Parameters:
    `blocRequeteVector` -
  Returns:

### buildBlocRequeteVector

    private java.util.Vector<BlocRequete> buildBlocRequeteVector(java.util.Vector<java.lang.String> prebuildRequest)

  create a bloc like query(each bloc correspond to a subquery linking input to output). One bloc is detected for each inheritance relationship If only one bloc is created, this bloc correspond to the query linking initial input annotation to output annotation

  Parameters:
    `prebuildRequest` -
  Returns:
    Vector

### deleteDoubleNull

    private void deleteDoubleNull()

### preBuildRequest

    private java.util.Vector<java.lang.String> preBuildRequest()

### namespaceToPrefix

    private void namespaceToPrefix()

  change each namespace of the query to its correponding prefix.

### addNamespaces

    private void addNamespaces()

  declare all needed namespaces at the beginning of the query

### invertShortestPathNodes

    private java.util.Vector<PathNode> invertShortestPathNodes(java.util.Vector<PathNode> spn)

  invert all elements of the vector containing the shortest path

  Parameters:
    `spn` - intial shortest path
  Returns:
    Vector invert shortest path

### postmodification

    private void postmodification()

  postmodify query in case of UNION and delete association table orientation (+ and - at beginning of a line)

### verifyNull

    private void verifyNull()

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD