Package org.openrdf.model

Examples of org.openrdf.model.Resource


    throws StoreConfigException
  {
    super.parse(model, implNode);

    try {
      Resource delegateNode = model.filter(implNode, DELEGATE, null).objectResource();
      if (delegateNode != null) {
        setDelegate(SailConfigUtil.parseRepositoryImpl(model, delegateNode));
      }
    }
    catch (ModelException e) {
View Full Code Here


   *         return value is not a URI.
   */
  public static URI getUniqueSubjectURI(Graph graph, URI pred, Value obj, Resource... contexts)
    throws GraphUtilException
  {
    Resource subject = getUniqueSubject(graph, pred, obj, contexts);

    if (subject instanceof URI) {
      return (URI)subject;
    }
    else {
View Full Code Here

   *         its return value is not a URI.
   */
  public static URI getOptionalSubjectURI(Graph graph, URI pred, Value obj, Resource... contexts)
    throws GraphUtilException
  {
    Resource subject = getOptionalSubject(graph, pred, obj, contexts);

    if (subject instanceof URI) {
      return (URI)subject;
    }
    else {
View Full Code Here

   * @return A hash code for the statement.
   */
  @Override
  public final int hashCode() {
    final int prime = 31;
    Resource ctx = getContext();
    int result = (ctx == null) ? 0 : ctx.hashCode();
    result = prime * result + getSubject().hashCode();
    result = prime * result + getPredicate().hashCode();
    result = prime * result + getObject().hashCode();
    return result;
  }
View Full Code Here

    sb.append(", ");
    sb.append(getPredicate());
    sb.append(", ");
    sb.append(getObject());
    sb.append(")");
    Resource ctx = getContext();
    if (ctx != null) {
      sb.append(" [").append(ctx).append("]");
    }

    return sb.toString();
View Full Code Here

      throw new SAXException("At least three values required for AddStatementOperation, found: "
          + parsedValues.size());
    }

    try {
      Resource subject = (Resource)parsedValues.get(0);
      URI predicate = (URI)parsedValues.get(1);
      Value object = parsedValues.get(2);
      Resource[] contexts = createContexts(3);

      parsedValues.clear();
View Full Code Here

      throw new SAXException("At least three values required for RemoveStatementsOperation, found: "
          + parsedValues.size());
    }

    try {
      Resource subject = (Resource)parsedValues.get(0);
      URI predicate = (URI)parsedValues.get(1);
      Value object = parsedValues.get(2);
      Resource[] contexts = createContexts(3);

      parsedValues.clear();
View Full Code Here

    this.closed = closed;
  }

  @Override
  public Resource export(Model model) {
    Resource resource = super.export(model);
    for (Map.Entry<URI, String> e : getGraphs().entrySet()) {
      BNode node = vf.createBNode();
      model.add(resource, GRAPH, node);
      model.add(node, NAME, e.getKey());
      if (e.getValue() != null) {
View Full Code Here

    if (!pred1.equals(pred2)) {
      // predicates don't match
      return false;
    }

    Resource subj1 = st1.getSubject();
    Resource subj2 = st2.getSubject();

    if (subj1 instanceof BNode && subj2 instanceof BNode) {
      BNode mappedBNode = bNodeMapping.get(subj1);

      if (mappedBNode != null) {
        // bNode 'subj1' was already mapped to some other bNode
        if (!subj2.equals(mappedBNode)) {
          // 'subj1' and 'subj2' do not match
          return false;
        }
      }
      else {
View Full Code Here

   *         return value is not a URI.
   */
  public static URI getUniqueSubjectURI(Model model, URI pred, Value obj, Resource... contexts)
    throws ModelException
  {
    Resource subject = getUniqueSubject(model, pred, obj, contexts);

    if (subject instanceof URI) {
      return (URI)subject;
    }
    else {
View Full Code Here

TOP

Related Classes of org.openrdf.model.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.