gr.forth.ics.rdfsuite.swkm.utils
Class Utils

java.lang.Object
  extended by gr.forth.ics.rdfsuite.swkm.utils.Utils

public class Utils
extends java.lang.Object


Field Summary
protected static org.apache.log4j.Logger log
           
 
Constructor Summary
Utils()
           
 
Method Summary
static boolean belongsToDefaultNamespace(java.lang.String uri)
           
static void checkNotDatatypeInSubjectOrObjectIfNotRange(RDF_Model model, java.lang.String subject, java.lang.String predicate, java.lang.String object, Position pos, java.lang.String by)
           
static java.lang.String getDBDateFormat(java.lang.String value, int dt)
          Takes as input an XML date/gyearMonth/gyear value and returns the respective date database value.
static java.lang.String getDBDatetime(java.lang.String dt)
           
static java.lang.String getDBDurationFormat(java.lang.String value)
           
static java.lang.String getLocalNamePart(java.lang.String uri)
          This method retrieves the local name part of a uri
static java.lang.String getNsPart(java.lang.String uri)
           
static java.lang.String getValueOfLiteral(java.lang.String literal)
          Retrieved the value of a string literal.
static boolean isLiteral(java.lang.String object)
           
static java.lang.String resolveNamespaceOfTriple(java.lang.String subject, java.lang.String predicate, java.lang.String object)
           
static java.lang.String setValueOfLiteralWith(java.lang.String literal, java.lang.String value)
          Sets the value part of the given literal with the given String Example: if literal="lala"@en and value=lolo then the method returns "lolo"@en
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final org.apache.log4j.Logger log
Constructor Detail

Utils

public Utils()
Method Detail

getLocalNamePart

public static java.lang.String getLocalNamePart(java.lang.String uri)
                                         throws gr.forth.ics.rdfsuite.services.exceptions.InvalidUriException
This method retrieves the local name part of a uri

Throws:
gr.forth.ics.rdfsuite.services.exceptions.InvalidUriException - if the uri is not "well formed"

resolveNamespaceOfTriple

public static java.lang.String resolveNamespaceOfTriple(java.lang.String subject,
                                                        java.lang.String predicate,
                                                        java.lang.String object)

getNsPart

public static java.lang.String getNsPart(java.lang.String uri)

isLiteral

public static boolean isLiteral(java.lang.String object)

belongsToDefaultNamespace

public static boolean belongsToDefaultNamespace(java.lang.String uri)

getDBDateFormat

public static java.lang.String getDBDateFormat(java.lang.String value,
                                               int dt)
Takes as input an XML date/gyearMonth/gyear value and returns the respective date database value.

Parameters:
dt - 0 if the value is of datatype date, 1 if the value is of datatype gyearMonth, 2 if the value is of datatype gyear

getDBDatetime

public static java.lang.String getDBDatetime(java.lang.String dt)

getDBDurationFormat

public static java.lang.String getDBDurationFormat(java.lang.String value)

getValueOfLiteral

public static java.lang.String getValueOfLiteral(java.lang.String literal)
Retrieved the value of a string literal. Example "lala"@en or "lala"^^ has value string lala

Parameters:
literal -
Returns:

setValueOfLiteralWith

public static java.lang.String setValueOfLiteralWith(java.lang.String literal,
                                                     java.lang.String value)
Sets the value part of the given literal with the given String Example: if literal="lala"@en and value=lolo then the method returns "lolo"@en

Parameters:
literal -
value -
Returns:

checkNotDatatypeInSubjectOrObjectIfNotRange

public static void checkNotDatatypeInSubjectOrObjectIfNotRange(RDF_Model model,
                                                               java.lang.String subject,
                                                               java.lang.String predicate,
                                                               java.lang.String object,
                                                               Position pos,
                                                               java.lang.String by)