org.ontoware.rdf2go.model.node
Interface Node

All Superinterfaces:
java.lang.Comparable<Node>, NodeOrVariable
All Known Subinterfaces:
BlankNode, DatatypeLiteral, LanguageTagLiteral, Literal, PlainLiteral, Resource, URI
All Known Implementing Classes:
ResourceImpl, URIImpl

public interface Node
extends NodeOrVariable, java.lang.Comparable<Node>

Marker interface for RDF types (URI, BlankNode, Literal) The following sorting order is defined by different Node types: URI > BlankNode > PlainLiteral > LanguageTaggedLiteral > DatatypedLiteral Nodes are expected to have correct implementations of equals(Object other) and hashcode()

Author:
voelkel

Method Summary
 BlankNode asBlankNode()
          A convenience method for a cast to org.ontoware.rdf2go.model.node.BlankNode
 DatatypeLiteral asDatatypeLiteral()
          A convenience method for a cast to org.ontoware.rdf2go.model.node.DatatypeLiteral
 LanguageTagLiteral asLanguageTagLiteral()
          A convenience method for a cast to org.ontoware.rdf2go.model.node.LanguageTagLiteral
 Literal asLiteral()
          A convenience method for a cast to org.ontoware.rdf2go.model.node.Literal
 Resource asResource()
          A convenience method for a cast to org.ontoware.rdf2go.model.node.Resource
 URI asURI()
          A convenience method for a cast to org.ontoware.rdf2go.model.node.URI
 java.lang.String toSPARQL()
          A convenience function to create SPARQL queries from nodes
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

asResource

Resource asResource()
                    throws java.lang.ClassCastException
A convenience method for a cast to org.ontoware.rdf2go.model.node.Resource

Returns:
this Node casted as a Resource
Throws:
java.lang.ClassCastException - if the node is not a Resource

asLiteral

Literal asLiteral()
                  throws java.lang.ClassCastException
A convenience method for a cast to org.ontoware.rdf2go.model.node.Literal

Returns:
this Node casted as a Literal
Throws:
java.lang.ClassCastException - if the node is not a Literal

asDatatypeLiteral

DatatypeLiteral asDatatypeLiteral()
                                  throws java.lang.ClassCastException
A convenience method for a cast to org.ontoware.rdf2go.model.node.DatatypeLiteral

Returns:
this Node casted as a DatatypeLiteral
Throws:
java.lang.ClassCastException - if the node is not a DatatypeLiteral

asLanguageTagLiteral

LanguageTagLiteral asLanguageTagLiteral()
                                        throws java.lang.ClassCastException
A convenience method for a cast to org.ontoware.rdf2go.model.node.LanguageTagLiteral

Returns:
this Node casted as a LanguageTagLiteral
Throws:
java.lang.ClassCastException - if the node is not a LanguageTagLiteral

asURI

URI asURI()
          throws java.lang.ClassCastException
A convenience method for a cast to org.ontoware.rdf2go.model.node.URI

Returns:
this Node casted as a URI
Throws:
java.lang.ClassCastException - if the node is not a URI

asBlankNode

BlankNode asBlankNode()
                      throws java.lang.ClassCastException
A convenience method for a cast to org.ontoware.rdf2go.model.node.BlankNode

Returns:
this Node casted as a BlankNode
Throws:
java.lang.ClassCastException - if the node is not a BlankNode

toSPARQL

java.lang.String toSPARQL()
A convenience function to create SPARQL queries from nodes

Returns:
this node in SPARQL syntax. A URI is wrapped in '<' and '>'. A literal is wrapped in '"' chars and escaped.


Copyright © 2005-2008 FZI - Forschungszentrum Informatik | Karlsruhe | Germany. All Rights Reserved.