org.eaglei.repository.model
Class QueryMacro

java.lang.Object
  extended by org.eaglei.repository.model.ImmutableObjectModel
      extended by org.eaglei.repository.model.QueryMacro
All Implemented Interfaces:
java.lang.Comparable

public class QueryMacro
extends ImmutableObjectModel
implements java.lang.Comparable

Object Model for query macros, used in the SPARQL Workbench. Query that picks up the macro definitions: SELECT ?l ?t FROM :NG_Query WHERE { ?s a :QueryMacro; rdfs:label ?l; :query ?t } Example macros defined (in n3): :macros rdf:_1 [ a :QueryMacro; rdfs:label "first macro"; :query "text of query macro string here" ]; rdf:_2 [ a :QueryMacro; rdfs:label "second macro"; :query "more macro here, don't forget to escape quotes" ].

Author:
Larry Stone Started March, 2011

Method Summary
 int compareTo(java.lang.Object o)
          
 boolean equals(java.lang.Object o)
          
static QueryMacro find(javax.servlet.http.HttpServletRequest request, org.openrdf.model.URI resource)
          Not implemented, no need to get one macro
static java.util.List<QueryMacro> findAll(javax.servlet.http.HttpServletRequest request)
          Get all macros
 java.lang.String getLabel()
          Getter for label
 java.lang.String getMacro()
          Getter for macro content
 org.openrdf.model.URI getURI()
          not really implemented
 int hashCode()
          
 java.lang.String toString()
          toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

findAll

public static java.util.List<QueryMacro> findAll(javax.servlet.http.HttpServletRequest request)
                                          throws javax.servlet.ServletException
Get all macros

Parameters:
request - a HttpServletRequest object.
Returns:
List of all macros found in RDF db
Throws:
javax.servlet.ServletException

compareTo

public int compareTo(java.lang.Object o)

Specified by:
compareTo in interface java.lang.Comparable

find

public static QueryMacro find(javax.servlet.http.HttpServletRequest request,
                              org.openrdf.model.URI resource)
Not implemented, no need to get one macro

Parameters:
request - a HttpServletRequest object.
resource - subject of the resource instance, a URI object.
Returns:
token as a org.eaglei.repository.EditToken object or null if none available.

getURI

public org.openrdf.model.URI getURI()
not really implemented

Specified by:
getURI in class ImmutableObjectModel
Returns:
the subject URI

getLabel

public java.lang.String getLabel()

Getter for label

Specified by:
getLabel in class ImmutableObjectModel
Returns:
the label

getMacro

public java.lang.String getMacro()

Getter for macro content

Returns:
the macro

toString

public java.lang.String toString()

toString

Overrides:
toString in class java.lang.Object
Returns:
a String object.

equals

public boolean equals(java.lang.Object o)

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object


Copyright © 2009-2011 Eagle-I. All Rights Reserved.