Example #1
0
 public Collection<TriplesMap> getTriplesMaps() {
   OBDAMappingTransformer transformer = new OBDAMappingTransformer();
   transformer.setOntology(ontology);
   Collection<TriplesMap> coll = new LinkedList<TriplesMap>();
   for (OBDAMappingAxiom axiom : this.mappings) {
     TriplesMap tm = transformer.getTriplesMap(axiom, prefixmng);
     coll.add(tm);
   }
   return coll;
 }
Example #2
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;
  }