com.clarkparsia.sparqlowl.parser.arq
Class ARQParserUtilities

java.lang.Object
  extended by com.clarkparsia.sparqlowl.parser.arq.ARQParserUtilities

public class ARQParserUtilities
extends java.lang.Object

Title: ARQ Parser Utilities

Description: Static utility methods and fields used by the ANTLR generated ARQ Tree Walker source. This code is in a separate Java file rather than in the ANTLR sources to make it easier to maintain with comfortable Java tools (e.g., Eclipse).

Copyright: Copyright (c) 2010

Company: Clark & Parsia, LLC.

Author:
Mike Smith msmith@clarkparsia.com

Field Summary
static com.hp.hpl.jena.graph.Node XSD_BOOLEAN_FALSE
          Jena node for "false"^^xsd:boolean
static com.hp.hpl.jena.graph.Node XSD_BOOLEAN_TRUE
          Jena node for "true"^^xsd:boolean
 
Constructor Summary
ARQParserUtilities()
           
 
Method Summary
static com.hp.hpl.jena.graph.Node createNonNegativeInteger(java.lang.String s)
          Create an xsd:nonNegativeInteger literal from a string.
static boolean isOWL2Datatype(com.hp.hpl.jena.graph.Node n)
          Test if a Node is an OWL 2 datatype.
static com.hp.hpl.jena.graph.Node listToTriples(java.util.List<com.hp.hpl.jena.graph.Node> nodes, java.util.Collection<com.hp.hpl.jena.graph.Triple> triples)
          Construct an RDF container from a List of nodes, preserving the ordering
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XSD_BOOLEAN_FALSE

public static final com.hp.hpl.jena.graph.Node XSD_BOOLEAN_FALSE
Jena node for "false"^^xsd:boolean


XSD_BOOLEAN_TRUE

public static final com.hp.hpl.jena.graph.Node XSD_BOOLEAN_TRUE
Jena node for "true"^^xsd:boolean

Constructor Detail

ARQParserUtilities

public ARQParserUtilities()
Method Detail

createNonNegativeInteger

public static com.hp.hpl.jena.graph.Node createNonNegativeInteger(java.lang.String s)
Create an xsd:nonNegativeInteger literal from a string. Useful when parsing number restrictions.

Parameters:
s - A String of the number to be parsed
Returns:
A literal Node

isOWL2Datatype

public static boolean isOWL2Datatype(com.hp.hpl.jena.graph.Node n)
Test if a Node is an OWL 2 datatype.

Parameters:
n - The Node to test
Returns:
true if n matches the URI of an OWL 2 datatype, else false

listToTriples

public static com.hp.hpl.jena.graph.Node listToTriples(java.util.List<com.hp.hpl.jena.graph.Node> nodes,
                                                       java.util.Collection<com.hp.hpl.jena.graph.Triple> triples)
Construct an RDF container from a List of nodes, preserving the ordering

Parameters:
nodes - The list of Nodes
triples - A mutable container to which the Triples representing the container will be added.
Returns:
The blank node used as the start of the container


Copyright © 2004 Evren Sirin. All Rights Reserved.