Package edu.mit.simile.fresnel.selection

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


              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();
View Full Code Here


              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);
          }
        }
View Full Code Here

              Value purposeNode = purposesI.next().getObject();
              if (purposeNode instanceof Resource) {
                Resource purposeRes = (Resource) purposeNode;
                out.addPurpose(new Purpose(purposeRes));
              } else {
                throw new ParsingException(purposeNode.toString() + "could not be used as a :Purpose");
              }
            }
          } finally {
            purposesI.close();
          }

          // label
            RepositoryResult<Statement> labelI = conn.getStatements(selected, FresnelCore.label, (Value) null, false);
          try {
            if (labelI.hasNext()) {
              Statement labelS = labelI.next();
              if (labelI.hasNext()) throw new ParsingException("Too many fresnel:label statements; only one allowed: " + selected);
              Value labelObj = labelS.getObject();
              out.setLabel(PropertyLabel.parse(labelObj));
            }
          } finally {
            labelI.close();
          }

          // value
            RepositoryResult<Statement> valueI = conn.getStatements(selected, FresnelCore.value, (Value) null, false);
          try {
            if (valueI.hasNext()) {
              Statement valueS = valueI.next();
              if (valueI.hasNext()) throw new ParsingException("Too many fresnel:value statements; only one allowed: " + selected);
              Value valueObj = valueS.getObject();
              out.setValueType(PropertyValue.parse(valueObj));
            }
          } finally {
            valueI.close();
View Full Code Here

                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) {
View Full Code Here

          Value purposeNode = purposesI.next().getObject();
          if (purposeNode instanceof Resource) {
            Resource purposeRes = (Resource) purposeNode;
            out.addPurpose(new Purpose(purposeRes));
          } else {
            throw new ParsingException(purposeNode.toString() + "could not be used as a :Purpose");
          }
        }
      } finally {
        purposesI.close();
      }
View Full Code Here

          Value purposeNode = purposesI.next().getObject();
          if (purposeNode instanceof Resource) {
            Resource purposeRes = (Resource) purposeNode;
            out.addPurpose(new Purpose(purposeRes));
          } else {
            throw new ParsingException(purposeNode.toString() + "could not be used as a :Purpose");
          }
        }
      } finally {
        purposesI.close();
      }
View Full Code Here

                domain = new FSESelector(domainL.getLabel(), _fslContext, conf.getNamespaceMap());
              } else if (domainL.getDatatype().equals(FresnelCoreTypes.sparqlSelector)) {
                domain = new SPARQLSelector(domainL.getLabel(), conf.getNamespaces());
              }                       
            } else {
              throw new ParsingException("Could not read member fresnel:primaryClass rdf:List.");                       
            }
            out.addPrimary(domain);
          }
        } else {
          throw new ParsingException("Could not read object of fresnel:primaryClass predicate, expecting an rdf:List.");
        }
      }
      groupPrimaries.close();
      conn.close();
    } catch (RepositoryException e) {
View Full Code Here

TOP

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

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.