Package com.hp.hpl.squirrelrdf.querymap.exceptions

Examples of com.hp.hpl.squirrelrdf.querymap.exceptions.UnanswerableException


      Node subject = triple.getSubject();
      Node predicate = triple.getPredicate();
      Node object = triple.getObject();
     
      if (predicate.isVariable())
        throw new UnanswerableException("I can't do predicate matches (yet).");
     
      if (predicate.equals(RDF.Nodes.type)) // RDB map is staticly typed, so this is not that useful
      {
        if (object.isConcrete())
        {
          Resource theClass = (Resource) configModel.asRDFNode(object);
          Table table = class2table.get(theClass);
          if (table == null)
            throw new InconsistentException("Unknown class: " + object);
          checkClasses(subject, theClass, nodeToClass);
          nodeToClass.put(subject, theClass);
          query.add(subject, table); // Just add the subject and table to the query.
        }
        else
          throw new UnanswerableException("No type matches (yet)");
        continue;
      }
     
      Resource prop = (Resource) configModel.getRDFNode(predicate);
      if (!prop2col.containsKey(prop))
        throw new InconsistentException("Unknown predicate: " + triple);

      /* Domain / Range checks -- subjects have types specific to tables, objects are literals */
      checkClasses(subject, prop.getProperty(RDFS.domain).getResource(), nodeToClass);
      checkClasses(object, RDFS.Literal, nodeToClass);
     
      //if (subject.isConcrete())
      //  throw new UnanswerableException("Concrete subject given: " + triple);
     
      if (object.isConcrete() && !object.isLiteral())
        throw new UnanswerableException("Object is resource: " + triple);
     
      // Ok, that's all the problem cases out the way (well, mostly)
      Col col = prop2col.get(prop);
     
      // Cleaning: bnodes -> =var or #var. That will hurt.
View Full Code Here

TOP

Related Classes of com.hp.hpl.squirrelrdf.querymap.exceptions.UnanswerableException

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.