Package org.ontoware.rdf2go.model.node

Examples of org.ontoware.rdf2go.model.node.Resource


    if(resourceSubject == null)
      throw new IllegalArgumentException("resourceSubject may not be null");
    if(classURI == null)
      throw new IllegalArgumentException("classURI may not be null");
    assertOpen(model);
    Resource rdfResource = RDFReactorRuntime.genericResource2RDF2Goresource(model,
            resourceSubject);
    return model.contains(rdfResource, RDF.type, classURI);
  }
View Full Code Here


    if(resourceSubject == null)
      throw new IllegalArgumentException("resourceSubject may not be null");
    if(propertyURI == null)
      throw new IllegalArgumentException("propertyURI may not be null");
    assertOpen(model);
    Resource rdfResource = RDFReactorRuntime.genericResource2RDF2Goresource(model,
            resourceSubject);
    return model.contains(rdfResource, propertyURI, Variable.ANY);
  }
View Full Code Here

    if(propertyURI == null)
      throw new IllegalArgumentException("propertyURI may not be null");
    if(value == null)
      throw new IllegalArgumentException("value may not be null");
    assertOpen(model);
    Resource rdfResource = RDFReactorRuntime.genericResource2RDF2Goresource(model,
            resourceSubject);
    Node node = RDFReactorRuntime.java2node(model, value);
    return model.contains(rdfResource, propertyURI, node);
  }
View Full Code Here

    if(propertyURI == null)
      throw new IllegalArgumentException("propertyURI may not be null");
    if(value == null)
      throw new IllegalArgumentException("value may not be null");
    assertOpen(model);
    Resource rdfResource = RDFReactorRuntime.genericResource2RDF2Goresource(model,
            resourceSubject);
    Node node = RDFReactorRuntime.java2node(model, value);
    model.removeStatement(rdfResource, propertyURI, node);
  }
View Full Code Here

    if(propertyURI == null)
      throw new IllegalArgumentException("propertyURI may not be null");
    if(value == null)
      throw new IllegalArgumentException("value may not be null");
    assertOpen(model);
    Resource rdfResource = RDFReactorRuntime.genericResource2RDF2Goresource(model,
            resourceSubject);
    long count = countPropertyValues(model, rdfResource, propertyURI);
    if(count > minCardinality)
      remove(model, rdfResource, propertyURI, value);
    else
View Full Code Here

    if(resourceSubject == null)
      throw new IllegalArgumentException("resourceSubject may not be null");
    if(propertyURI == null)
      throw new IllegalArgumentException("propertyURI may not be null");
    assertOpen(model);
    Resource rdfResource = RDFReactorRuntime.genericResource2RDF2Goresource(model,
            resourceSubject);
    model.removeStatements(rdfResource, propertyURI, Variable.ANY);
  }
View Full Code Here

      throw new IllegalArgumentException("propertyURI may not be null");
    if(value == null)
      throw new IllegalArgumentException("value may not be null");
    assertOpen(model);
    synchronized(model) {
      Resource rdfResource = RDFReactorRuntime.genericResource2RDF2Goresource(model,
              resourceSubject);
      removeAll_unsynchronized(model, rdfResource, propertyURI);
      Node node = RDFReactorRuntime.java2node(model, value);
      model.addStatement(rdfResource, propertyURI, node);
    }
View Full Code Here

      throw new IllegalArgumentException("model may not be null");
    if(resourceSubject == null)
      throw new IllegalArgumentException("resourceSubject may not be null");
    if(propertyURI == null)
      throw new IllegalArgumentException("propertyURI may not be null");
    Resource rdfResource = RDFReactorRuntime.genericResource2RDF2Goresource(model,
            resourceSubject);
    ClosableIterator<Statement> it = model.findStatements(rdfResource, propertyURI,
            Variable.ANY);
    boolean result = it.hasNext();
    it.close();
View Full Code Here

  public static Resource toSubject(String subject) {
    if(subject == null) {
      throw new NullPointerException("subject cannot be null");
    }
   
    Resource mySubject = null;
   
    if(subject.equals("_:")) {
      mySubject = LazyInitializer.instance.createBlankNode();
    } else if(subject.startsWith("_:")) {
      mySubject = LazyInitializer.instance.createBlankNode(subject.replaceFirst("_:", ""));
View Full Code Here

    model.open();
   
    // add statements
   
    // the cleanest way
    Resource s = model.createURI("urn:test:a");
    URI p = model.createURI("http://www.w3.org/2000/01/rdf-schema#label");
    Node o = model.createPlainLiteral("Hello World A");
    model.addStatement(s, p, o);
   
    // a shortcut: built-in URIs for RDF and RDFS
View Full Code Here

TOP

Related Classes of org.ontoware.rdf2go.model.node.Resource

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.