Package edu.mit.simile.fresnel.selection

Examples of edu.mit.simile.fresnel.selection.UnresolvableException


      RepositoryConnection conn = source.getConnection();
            RepositoryResult<Statement> facetI = conn.getStatements(focus, Facets.facets, (Value) null, false);
      if (facetI.hasNext()) {
        Statement facetStmt = (Statement) facetI.next();
        Value facetsNode = facetStmt.getObject();
        if (facetI.hasNext()) throw new UnresolvableException("More than one :facets value available");
        if (facetsNode instanceof Resource && RDFList.isRDFList(source, (Resource) facetsNode)) {
          RDFList facetRDFList = new RDFList(source, (Resource) facetsNode);
          if (facetRDFList.isValid()) {
            for (Iterator listI = facetRDFList.iterator(); listI.hasNext(); ) {
              Resource facetNode = (Resource) listI.next();
              Facet facet = new Facet(facetNode);
              out.addFacet(facet);
            }
          } else {
            throw new ParsingException(facetsNode.toString() + "is not a valid rdf:List");
          }
        }
      }
      facetI.close();

            RepositoryResult<Statement> hidesI = conn.getStatements(focus, Facets.hides, (Value) null, false);
      if (hidesI.hasNext()) {
        Statement facetStmt = hidesI.next();
        Value facetsNode = facetStmt.getObject();
        if (hidesI.hasNext()) throw new UnresolvableException("More than one :hides value available");
        if (facetsNode instanceof Resource && RDFList.isRDFList(source, (Resource) facetsNode)) {
          RDFList facetRDFList = new RDFList(source, (Resource) facetsNode);
          if (facetRDFList.isValid()) {
            for (Iterator listI = facetRDFList.iterator(); listI.hasNext(); ) {
              Resource facetNode = (Resource) listI.next();
              Facet facet = new Facet(facetNode);
              out.addHide(facet);
            }
          } else {
            throw new ParsingException(facetsNode.toString() + "is not a valid rdf:List");
          }
        }
      }
      hidesI.close();
      conn.close();
    } catch (RepositoryException e) {
      throw new UnresolvableException("Problem connecting to repository: " + e.getLocalizedMessage());
    }

    TypeSet forTypes = TypeSet.parse(source, focus);
    out.setForTypes(forTypes);
View Full Code Here


            RepositoryResult<Statement> typeI = conn.getStatements(focus, Facets.types, (Value) null, false);
      try {
        if (typeI.hasNext()) {
          Statement typeStmt = typeI.next();
          Value typesNode = typeStmt.getObject();
          if (typeI.hasNext()) throw new UnresolvableException("More than one :types value available");
          if (typesNode instanceof Resource && RDFList.isRDFList(source, (Resource) typesNode)) {
            RDFList typeRDFList = new RDFList(source, (Resource) typesNode);
            if (typeRDFList.isValid()) {
              for (Iterator listI = typeRDFList.iterator(); listI.hasNext(); ) {
                Resource typeNode = (Resource) listI.next();
                out.addType(typeNode);
              }
            } else {
              throw new ParsingException(typesNode.toString() + "is not a valid rdf:List");
            }
          } else if (typesNode.equals(Facets.allTypes)) {
            out = new TypeSet(true);
          }
        }
      } finally {
        typeI.close();
      }
      conn.close();
    } catch (RepositoryException e) {
      throw new UnresolvableException("Problem connecting to repository: " + e.getLocalizedMessage());
    }
    return out;
  }
View Full Code Here

          }
          valueFormatI.close();

          conn.close();
        } catch (RepositoryException e) {
          throw new UnresolvableException("Problem connecting to repository: " + e.getLocalizedMessage());
        }
       
        return out;
    }
View Full Code Here

          Resource groupResource = null;
          Value groupValue = groupStatement.getObject();
          if (groupValue instanceof Resource)
            groupResource = (Resource) groupValue;
          else
            throw new UnresolvableException("Group referred to is not a resource: " + groupValue);
          boolean exists = this._groups.containsKey(groupResource);
          Group group = exists ?
              (Group) this._groups.get(groupResource) :
                Group.parse(this._source, groupResource, this);

              try {
                group.addLens(lensLookup(groupMember));
              } catch (ResourceNotFoundException e) {
                try {
                  group.addFormat(formatLookup(groupMember));
                } catch (ResourceNotFoundException re) {
                  throw new ParsingException("Could not find useful parsing information for resource: " + ((URI) groupMember).toString());
                }
              }

              // Group only needs to be parsed once, don't add it if it already exists
              if (!exists) {
                addGroup(group);
              }
        } catch (ParsingException e) {
          gather(e);
        } catch (UnresolvableException u) {
          gather(u);
        }
      }
      it.close();
      conn.close();
    } catch (RepositoryException e) {
      throw new UnresolvableException("Problem connecting to repository: " + e.getLocalizedMessage());
    }
  }
View Full Code Here

          addLens(out);
        } else {
          throw new ResourceNotFoundException("Explicitly named lens not found in configuration");
        }
      } catch (RepositoryException e) {
        throw new UnresolvableException("Problem connecting to repository: " + e.getLocalizedMessage());
      }
      finally {
        try {
          conn.close();
        }
View Full Code Here

          addGroup(out);
        } else {
          throw new ResourceNotFoundException("Explicitly named group not found in configuration");
        }
      } catch (RepositoryException e) {
        throw new UnresolvableException("Problems connecting to repository: " + e.getLocalizedMessage());
      }
      finally {
        if (conn != null)
          try {
            conn.close();
View Full Code Here

        } else {
          throw new ResourceNotFoundException("Explicitly named style not found in configuration");
        }
        conn.close();
      } catch (RepositoryException e) {
        throw new UnresolvableException("Problem connecting to repository: " + e.getLocalizedMessage());
      }
    }
    return out;
  }
View Full Code Here

        out.addResourceFormat(FormatDescription.parse(in, formatObj));
      }
      resourceFormatI.close();
      conn.close();
    } catch (RepositoryException e) {
      throw new UnresolvableException("Problem connecting to repository: " + e.getLocalizedMessage());
    }
    return out;
  }
View Full Code Here

      }
      resourceFormatI.close();

      conn.close();
    } catch (RepositoryException e) {
      throw new UnresolvableException("Problem connecting to repository: " + e.getLocalizedMessage());
    }
   
    return out;
  }
View Full Code Here

            if (labelRes.equals(FresnelCore.show)) {
                out.setIsShown(true);
            } else if (labelRes.equals(FresnelCore.none)) {
                out.setIsShown(false);
            } else {
                throw new UnresolvableException("Cannot resolve value of fresnel:label: " + labelRes);
            }
        } else if (label instanceof Literal) {
            out.setString(((Literal) label).getLabel());
        } else {
            throw new UnresolvableException("Cannot resolve value of fresnel:label: " + label);
        }
        return out;
    }
View Full Code Here

TOP

Related Classes of edu.mit.simile.fresnel.selection.UnresolvableException

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.