Package org.apache.jena.atlas.lib

Examples of org.apache.jena.atlas.lib.InternalErrorException


  private Object getOne(EntityDefinition entityDef, String field) {
      Collection<Node> x = entityDef.getPredicates(field) ;
      if ( x == null || x.size() == 0 )
          return null ;
      if ( x.size() != 1 )
          throw new InternalErrorException("Not unique: "+field) ;
        return x.iterator().next() ;
    }
View Full Code Here


        }

        DatasetGraph dsg = execCxt.getDataset() ;

        if (!argSubject.isNode())
            throw new InternalErrorException("Subject is not a node (it was earlier!)") ;

        Node s = argSubject.getArg() ;

        if (s.isLiteral())
            // Does not match
View Full Code Here

    }

    DatasetGraph dsg = execCxt.getDataset();

    if (!argSubject.isNode())
      throw new InternalErrorException(
          "Subject is not a node (it was earlier!)");

    Node s = argSubject.getArg();

    if (s.isLiteral())
View Full Code Here

            {
                Model model = ModelFactory.createDefaultModel() ;
                for ( String uri : graphURLs )
                {
                    if ( uri == null || uri.equals("") )
                        throw new InternalErrorException("Default graph URI is null or the empty string";

                    try {
                        //TODO Clearup - RIOT integration.
                        GraphLoadUtils.loadModel(model, uri, MaxTriples) ;
                        log.info(format("[%d] Load (default graph) %s", action.id, uri)) ;
                    } catch (RiotException ex) {
                        log.info(format("[%d] Parsing error loading %s: %s", action.id, uri, ex.getMessage())) ;
                        errorBadRequest("Failed to load URL (parse error) "+uri+" : "+ex.getMessage()) ;
                    } catch (Exception ex)
                    {
                        log.info(format("[%d] Failed to load (default) %s: %s", action.id, uri, ex.getMessage())) ;
                        errorBadRequest("Failed to load URL "+uri) ;
                    }
                }
                dataset.setDefaultModel(model) ;
            }
            // ---- Named graphs
            if ( namedGraphs != null )
            {
                for ( String uri : namedGraphs )
                {
                    if ( uri == null || uri.equals("") )
                        throw new InternalErrorException("Named graph URI is null or the empty string";

                    try {
                        Model model = ModelFactory.createDefaultModel() ;
                        GraphLoadUtils.loadModel(model, uri, MaxTriples) ;
                        log.info(format("[%d] Load (named graph) %s", action.id, uri)) ;
View Full Code Here

  private Object getOne(EntityDefinition entityDef, String field) {
      Collection<Node> x = entityDef.getPredicates(field) ;
      if ( x == null || x.size() == 0 )
          return null ;
      if ( x.size() != 1 )
          throw new InternalErrorException("Not unique: "+field) ;
        return x.iterator().next() ;
    }
View Full Code Here

        try {
            e = new StringEntity(content, "UTF-8");
            e.setContentType(contentType);
            execHttpPost(url, e, acceptType, handler, httpClient, httpContext, authenticator);
        } catch (UnsupportedEncodingException e1) {
            throw new InternalErrorException("Platform does not support required UTF-8");
        } finally {
            closeEntity(e);
        }
    }
View Full Code Here

        try {
            e = new StringEntity(content, "UTF-8");
            e.setContentType(contentType);
            execHttpPut(url, e, httpClient, httpContext, authenticator);
        } catch (UnsupportedEncodingException e1) {
            throw new InternalErrorException("Platform does not support required UTF-8");
        } finally {
            closeEntity(e);
        }
    }
View Full Code Here

            for (Pair p : params.pairs())
                nvps.add(new BasicNameValuePair(p.getName(), p.getValue()));
            HttpEntity e = new UrlEncodedFormEntity(nvps, "UTF-8");
            return e;
        } catch (UnsupportedEncodingException e) {
            throw new InternalErrorException("Platform does not support required UTF-8");
        }
    }
View Full Code Here

        {
            if ( node.isURI() )         return labelForURI(node) ;
            if ( node.isLiteral() )     return labelForLiteral(node) ;
            if ( node.isBlank() )       return labelForBlank(node) ;
            if ( node.isVariable() )    return labelForVar(node) ;
            throw new InternalErrorException("Node type not supported: "+node) ;
        }
View Full Code Here

                return NodeFactory.createLiteral(lex, lang, null);
            }
            final RDFDatatype dt = NodeFactory.getType(datatype);
            return NodeFactory.createLiteral(lex, dt);
        } else {
            throw new InternalErrorException("Node is not a IRI, bNode or a literal: " + type);
            // /*
            // * "value" : The value of the node.
            // * "subject" can be an IRI or blank node id.
            // * "predicate" should only ever be an IRI
            // * "object" can be and IRI or blank node id, or a literal value
View Full Code Here

TOP

Related Classes of org.apache.jena.atlas.lib.InternalErrorException

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.