Package org.ontoware.rdf2go.model.node.impl

Examples of org.ontoware.rdf2go.model.node.impl.URIImpl


  @Test
  public void testUriPrefixRename() {
    Model m = RDF2Go.getModelFactory().createModel();
    m.open();

    URI a = new URIImpl("urn:test:a");
    URI b = new URIImpl("urn:test:b");
    URI c = new URIImpl("urn:test:c");

    URI superRel = new URIImpl(
        "http://www.semanticdesktop.org/ontologies/2007/09/cds/hasSuperRelation");
    m.addStatement(superRel, b, c);
    m.addStatement(a, superRel, c);
    m.addStatement(a, b, superRel);
    NamespaceSearchReplaceRule.searchAndReplace(m, "urn:test:", "http://example.com#");
View Full Code Here


     
      boolean match = false;
      if(s instanceof URI && s.asURI().toString().startsWith(searchURIPrefix)) {
        match = true;
        String sURI = s.asURI().toString().replace(searchURIPrefix, replaceURIPrefix);
        s = new URIImpl(sURI);
      }
      if(p.toString().startsWith(searchURIPrefix)) {
        match = true;
        String pURI = p.toString().replace(searchURIPrefix, replaceURIPrefix);
        p = new URIImpl(pURI);
       
      }
      if(o instanceof URI && o.asURI().toString().startsWith(searchURIPrefix)) {
        match = true;
        String oURI = o.asURI().toString().replace(searchURIPrefix, replaceURIPrefix);
        o = new URIImpl(oURI);
      }
     
      if(match) {
        remove.addStatement(stmt);
        add.addStatement(s, p, o);
View Full Code Here

    } catch(IllegalArgumentException e) {
      throw new ModelRuntimeException("Wrong URI format for Sesame", e);
    }
   
    // return an URI if no error occured
    return new URIImpl(uriString, false);
  }
View Full Code Here

              + value.getClass().getName());
    }
  }
 
  public static URI toRdf2go(org.openrdf.model.URI uri) {
    return uri == null ? null : new URIImpl(uri.toString(), false);
  }
View Full Code Here

    Object dataType = literal.getDatatype();
   
    if(language != null) {
      return new LanguageTagLiteralImpl(label, language);
    } else if(dataType != null) {
      return new DatatypeLiteralImpl(label, new URIImpl(dataType.toString(), false));
    } else {
      return new PlainLiteralImpl(label);
    }
  }
View Full Code Here

 
  private void init() {
    this.valueFactory = this.repository.getValueFactory();
   
    if(this.context == null) {
      this.context = new URIImpl(DEFAULT_CONTEXT, false);
      this.openRdfContext = DEFAULT_OPENRDF_CONTEXT;
    } else {
      this.openRdfContext = this.valueFactory.createURI(this.context.toString());
    }
  }
View Full Code Here

   * @throws ModelRuntimeException if URI syntax is wrong
   *
   * [Generated from RDFReactor template rule #c7]
   */
  public List ( Model model, String uriString, boolean write) throws ModelRuntimeException {
    super(model, RDFS_CLASS, new URIImpl(uriString,false), write);
  }
View Full Code Here

   * @throws ModelRuntimeException if URI syntax is wrong
   *
   * [Generated from RDFReactor template rule #c7]
   */
  public Datatype ( Model model, String uriString, boolean write) throws ModelRuntimeException {
    super(model, RDFS_CLASS, new URIImpl(uriString,false), write);
  }
View Full Code Here

   * @throws ModelRuntimeException if URI syntax is wrong
   *
   *             [Generated from RDFReactor template rule #c7]
   */
  public Alt(Model model, String uriString, boolean write) throws ModelRuntimeException {
    super(model, RDFS_CLASS, new URIImpl(uriString, false), write);
  }
View Full Code Here

   * @throws ModelRuntimeException if URI syntax is wrong
   *
   * [Generated from RDFReactor template rule #c7]
   */
  public Ontology ( Model model, String uriString, boolean write) throws ModelRuntimeException {
    super(model, RDFS_CLASS, new URIImpl(uriString,false), write);
  }
View Full Code Here

TOP

Related Classes of org.ontoware.rdf2go.model.node.impl.URIImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.