Package org.ontoware.rdf2go.model.node

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


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


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

    if(instanceResource == null)
      throw new IllegalArgumentException("instanceResource  may not be null");
    if(propertyURI == null)
      throw new IllegalArgumentException("propertyURI may not be null");
    assertOpen(model);
    Resource rdfResource = RDFReactorRuntime.genericResource2RDF2Goresource(model,
            instanceResource);
    ClosableIterator<Node> it = getAll(model, rdfResource, propertyURI, Node.class);
    if(it.hasNext()) {
      Node result = it.next();
      return result;
View Full Code Here

    if(propertyURI == null)
      throw new IllegalArgumentException("propertyURI may not be null");
    if(returnType == null)
      throw new IllegalArgumentException("returnType may not be null");
    assertOpen(model);
    Resource rdfResource = RDFReactorRuntime.genericResource2RDF2Goresource(model,
            resourceSubject);
    ClosableIterator<Statement> it = model.findStatements(rdfResource, propertyURI,
            Variable.ANY);
    return new ConvertingClosableIterator<T>(new ProjectingIterator<Node>(it,
            ProjectingIterator.projection.Object), model, returnType);
View Full Code Here

    if(propertyURI == null)
      throw new IllegalArgumentException("propertyURI may not be null");
    if(returnType == null)
      throw new IllegalArgumentException("returnType may not be null");
    assertOpen(model);
    Resource rdfResource = RDFReactorRuntime.genericResource2RDF2Goresource(model,
            resourceSubject);
    return new ReactorResult<T>(model, new TriplePatternImpl(rdfResource, propertyURI,
            Variable.ANY, TriplePatternImpl.SPO.OBJECT), returnType);
  }
View Full Code Here

    if(propertyURI == null)
      throw new IllegalArgumentException("propertyURI may not be null");
    if(returnType == null)
      throw new IllegalArgumentException("returnType may not be null");
    assertOpen(model);
    Resource rdfResource = RDFReactorRuntime.genericResource2RDF2Goresource(model,
            resourceSubject);
    ClosableIterator<T> it = getAll(model, rdfResource, propertyURI, returnType);
    return asList(it);
  }
View Full Code Here

    if(propertyURI == null)
      throw new IllegalArgumentException("propertyURI may not be null");
    if(returnType == null)
      throw new IllegalArgumentException("returnType may not be null");
    assertOpen(model);
    Resource rdfResource = RDFReactorRuntime.genericResource2RDF2Goresource(model,
            resourceSubject);
    ClosableIterator<T> it = getAll(model, rdfResource, propertyURI, returnType);
    return asArray(it, returnType);
  }
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);
    ClosableIterator<Statement> it = model.findStatements(rdfResource, propertyURI,
            Variable.ANY);
    return new ProjectingIterator<Node>(it, ProjectingIterator.projection.Object);
  }
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);
    ClosableIterator<Node> it = getAll_asNode(model, rdfResource, propertyURI);
    return asList(it);
  }
View Full Code Here

    if(value == null)
      throw new IllegalArgumentException("value may not be null");
    assertOpen(model);
    Node valueNode = RDFReactorRuntime.java2node(model, value);
    ClosableIterator<Statement> it = model.findStatements(Variable.ANY, propertyURI, valueNode);
    Resource result = null;
    if(it.hasNext()) {
      result = it.next().getSubject();
    }
    if(it.hasNext()) {
      throw new RDFDataException("Found more than one inverse of " + propertyURI
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.