Exemplo n.º 1
0
    /**
     * Add this graph to the set of data to be added, to the specified named graph, when this
     * operation is executed
     *
     * @param theGraphURI the named graph the data should be added to
     * @param theGraph the data to add
     */
    public void add(java.net.URI theGraphURI, Graph theGraph) {
      Graph aGraph = mAdd.get(theGraphURI);

      if (aGraph == null) {
        aGraph = new ExtGraph();
      }

      aGraph.addAll(theGraph);

      mAdd.put(theGraphURI, aGraph);
    }
Exemplo n.º 2
0
    /**
     * Add this graph to the set of data to be removed, from the specified named graph, when this
     * operation is executed
     *
     * @param theGraphURI the named graph the data should be removed from
     * @param theGraph the data to remove
     */
    public void remove(java.net.URI theGraphURI, Graph theGraph) {
      Graph aGraph = mRemove.get(theGraphURI);

      if (aGraph == null) {
        aGraph = new ExtGraph();
      }

      aGraph.addAll(theGraph);

      mRemove.put(theGraphURI, aGraph);
    }
Exemplo n.º 3
0
  /**
   * call this method if you need the RDF Graph that represents the R2RML mappings
   *
   * @return an RDF Graph
   */
  @Deprecated
  public Graph getGraph() {
    OBDAMappingTransformer transformer = new OBDAMappingTransformer();
    transformer.setOntology(ontology);
    List<Statement> statements = new ArrayList<Statement>();

    for (OBDAMappingAxiom axiom : this.mappings) {
      List<Statement> statements2 = transformer.getStatements(axiom, prefixmng);
      statements.addAll(statements2);
    }
    @SuppressWarnings("deprecation")
    Graph g = new GraphImpl();
    g.addAll(statements);
    return g;
  }