Package com.hp.hpl.jena.shared

Examples of com.hp.hpl.jena.shared.JenaException


            return new FileOutputStream(url.getFile());
          throw new IllegalArgumentException("Can only save to file: scheme");
        }
        return new LazyURLInputStream(url);
      } catch (MalformedURLException e) {
        throw new JenaException( e );
      } catch (IOException e) {
        e.printStackTrace();
        throw new JenaException( e );
      }
    }
    if (!in)
      throw new IllegalArgumentException("Can only save to URLs");
View Full Code Here


     * define a top concept (e.g. <code>owl:Thing</code>)
     */
    public static OntClass getLCA( OntModel m, OntClass u, OntClass v ) {
        Resource root = m.getProfile().THING();
        if (root == null) {
            throw new JenaException( "The given OntModel has a language profile that does not define a generic root class (such as owl:Thing)" );
        }

        root = root.inModel( m );
        return getLCA( m, root.as( OntClass.class ), u, v );
    }
View Full Code Here

    public synchronized void write(Model model, OutputStream output, String base)
  {
    try {
      Writer w =  new BufferedWriter(new OutputStreamWriter(output, "UTF-8")) ;
      write(model, w, base) ;
      try { w.flush() ; } catch (IOException ioEx) { throw new JenaException(ioEx) ; }
    } catch (java.io.UnsupportedEncodingException ex)
    {
      System.err.println("Failed to create UTF-8 writer") ;
    }
  }
View Full Code Here

    {
      StmtIterator sIter = r.getModel().listStatements(r, RDF.first, (RDFNode)null) ;
      list.add(sIter.nextStatement().getObject()) ;
      if ( sIter.hasNext() )
        // @@ need to cope with this (unusual) case
        throw new JenaException("N3: Multi valued list item") ;
      sIter = r.getModel().listStatements(r, RDF.rest, (RDFNode)null) ;
      r = (Resource)sIter.nextStatement().getObject() ;
      if ( sIter.hasNext() )
        throw new JenaException("N3: List has two tails") ;
    }
    return list.iterator() ;
  }
View Full Code Here

  public void setIndent(int x) { currentIndent = x ; }
 
  public void print(String s)
  {
    try { writer.write(s); column += s.length() ; }
    catch (java.io.IOException ex) { throw new JenaException(ex) ; }
  }
View Full Code Here

  }

  public void println(String s)
  {
    try { writer.write(s);  println() ; }
    catch (java.io.IOException ex) { throw new JenaException(ex) ; }
  }
View Full Code Here

      writer.flush() ;
      column = 0 ;
      row++ ;
      padTo() ;
    }
    catch (java.io.IOException ex) { throw new JenaException(ex) ; }
  }
View Full Code Here

    for ( int i = 0 ; i < currentIndent ; i++ )
      writer.write(' ') ;
    column = column + currentIndent ;
  }
 
  public void flush() { try { writer.flush() ; } catch (IOException ioEx) { throw new JenaException(ioEx) ; } }
View Full Code Here

      writer.write(' ') ;
    column = column + currentIndent ;
  }
 
  public void flush() { try { writer.flush() ; } catch (IOException ioEx) { throw new JenaException(ioEx) ; } }
  public void close() { try { writer.close() ; } catch (IOException ioEx) { throw new JenaException(ioEx) ; } }
View Full Code Here

    */
    public static OntModelSpec assemble( Resource root )
        {
        Object assembled = Assembler.general.open( root );
        if (!(assembled instanceof OntModelSpec))
            throw new JenaException( "assemble: expected an OntModelSpec, but got a " + assembled.getClass().getName() );
        return (OntModelSpec) assembled;
        }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.shared.JenaException

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.