Java Doc for RDFTool.java in  » Search-Engine » semweb4j » org » ontoware » rdf2go » util » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Search Engine » semweb4j » org.ontoware.rdf2go.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.ontoware.rdf2go.util.RDFTool

RDFTool
public class RDFTool (Code)
RDFTool, a helper utility to cope with RDF in general. The accessor methods are also handled by the RDFReactor runtime.

This tool has been part of gnowsis.org.


author:
   Leo Sauermann (leo@gnowsis.com), 2003-2007
author:
   Max Völkel




Method Summary
public static  ModelcopyModel(Model m)
    
public static  Stringdate2String(Date date)
     format the given date in a good date format: ISO 8601, using only the date and not the T seperator example: 2003-01-22 Timezone is ignored.
public static  StringdateTime2DateString(Date date)
     format the given date in a good date format: ISO 8601, using only the date and not the T seperator example: 2003-01-22 Timezone is ignored.
public static  StringdateTime2String(Date date)
     format the given date in a good dateTime format: ISO 8601, using the T seperator and the - and : seperators accordingly.
public static  StatementfindStatement(Model model, ResourceOrVariable subject, UriOrVariable predicate, NodeOrVariable object)
     find the first statement that fits the passed triple pattern and return it.
public static  DateFormatgetDateFormat()
     format to express dates in ISO 8601.
public static  DateFormatgetDateTimeFormat()
     get a DateFormat to format dates according to ISO 8601.
public static  StringgetGoodLabel(Node o, Model source)
     Get the Displaylabel of a Node.
public static  StringgetLabel(Node o)
     Get the label of a Node.
public static  StringgetShortName(String uri)
     The passed uri identifies something on the web, probably a namespace.
public static  NodegetSingleValue(Model m, Resource res, URI pred)
     get the property pred of the resource res.
public static  NodegetSingleValue(ModelSet m, Resource res, URI pred)
    
public static  StringgetSingleValueString(Model m, Resource res, URI pred)
     read the values of a predicate of a resource.
public static  StringgetSingleValueString(ModelSet modelset, Resource res, URI pred)
     read the values of a predicate of a resource.
public static  SyntaxguessSyntax(String filenname)
    
public static  StringmodelToString(Model model)
    
public static  StringmodelToString(ModelSet modelset)
    
public static  StringmodelToString(Model model, Syntax syntax)
    
public static  StringmodelToString(ModelSet modelset, Syntax syntax)
    
public static  voidsetSingleValue(Model m, Resource res, URI pred, Node value)
     set the property pred of the resource res.
public static  voidsetSingleValue(Model m, Resource res, URI pred, String value)
     set the property pred of the resource res.
public static  Stringsha1sum(String data)
     compute the sha1sum of a string (useful for handling FOAF data).
public static  Datestring2Date(String isodate)
     try to get a date out of a string.
public static  Datestring2DateTime(String date)
     format the given date in a good date format: ISO 8601, using only the date and not the T seperator example: 2003-01-22 This ignores timezones.
public static  ModelstringToModel(String rdfxml)
    
public static  ModelstringToModel(String string, Syntax syntax)
    



Method Detail
copyModel
public static Model copyModel(Model m)(Code)

Parameters:
  m - the model to copy a copy of the model in a memory model



date2String
public static String date2String(Date date)(Code)
format the given date in a good date format: ISO 8601, using only the date and not the T seperator example: 2003-01-22 Timezone is ignored.
Parameters:
  date - a formatted string.



dateTime2DateString
public static String dateTime2DateString(Date date)(Code)
format the given date in a good date format: ISO 8601, using only the date and not the T seperator example: 2003-01-22 Timezone is ignored.
Parameters:
  date - a formatted string.RDFTool.date2String(Date)



dateTime2String
public static String dateTime2String(Date date)(Code)
format the given date in a good dateTime format: ISO 8601, using the T seperator and the - and : seperators accordingly. example: 2003-01-22T17:00:00
Parameters:
  date - a formatted string.



findStatement
public static Statement findStatement(Model model, ResourceOrVariable subject, UriOrVariable predicate, NodeOrVariable object)(Code)
find the first statement that fits the passed triple pattern and return it.
Parameters:
  model - the model to search on
Parameters:
  subject - subject
Parameters:
  predicate - predicate
Parameters:
  object - object a statement (the first found) or null, if nothing matched
throws:
  RuntimeException - if the model throws an exception



getDateFormat
public static DateFormat getDateFormat()(Code)
format to express dates in ISO 8601. Timezone is ignored. the DateFormat to format dates (without time) according toISO8601.



getDateTimeFormat
public static DateFormat getDateTimeFormat()(Code)
get a DateFormat to format dates according to ISO 8601. This ignored timezones. a dateformat.



getGoodLabel
public static String getGoodLabel(Node o, Model source)(Code)
Get the Displaylabel of a Node. For resources, the "rdfs:label" property is returned, if there is none, the url is shortened to a localname. If it is a Literal, return the Lexical Form. If it is null, returns null Results may vary.
Parameters:
  o - the node to check
Parameters:
  source - the model to ask a string representation of the node or null.



getLabel
public static String getLabel(Node o)(Code)
Get the label of a Node. If it is a resource, return the local name (the last part of the URI). If it is a Literal, return the Lexical Form (the value). If it is null, returns null.
Parameters:
  o - the node to check a string representation of the node or null.



getShortName
public static String getShortName(String uri)(Code)
The passed uri identifies something on the web, probably a namespace. To shorten this, parse the url for something like a localname. Returns the last string after a '#' or a '/'.
Parameters:
  uri - a URI a short name for it, for display.



getSingleValue
public static Node getSingleValue(Model m, Resource res, URI pred)(Code)
get the property pred of the resource res. If there is none, return null. If there are mutliple, return any.
Parameters:
  m - the model to read from
Parameters:
  res - the resource
Parameters:
  pred - the predicate to read the value or null



getSingleValue
public static Node getSingleValue(ModelSet m, Resource res, URI pred)(Code)



getSingleValueString
public static String getSingleValueString(Model m, Resource res, URI pred)(Code)
read the values of a predicate of a resource. If a value exists, return a string representation of it. When multiple triples with this subject/predicate exist, choose one at random.
Parameters:
  m - the model to read from
Parameters:
  res - the resource
Parameters:
  pred - the predicate to read a string representation of the value, or null. Literals arereturned using their Value (not toString()).



getSingleValueString
public static String getSingleValueString(ModelSet modelset, Resource res, URI pred)(Code)
read the values of a predicate of a resource. If a value exists, return a string representation of it. When multiple triples with this subject/predicate exist, choose one at random.
Parameters:
  modelset - the model to read from
Parameters:
  res - the resource
Parameters:
  pred - the predicate to read a string representation of the value, or null. Literals arereturned using their Value (not toString()).



guessSyntax
public static Syntax guessSyntax(String filenname)(Code)
guess the RDF syntax of a filename inspired by com.hp.hpl.jena.graph.impl.FileGraph#guessLang with the addition of toLowerCase
Parameters:
  filenname - the filename, we will look at the suffix after "." the guessed RDF syntax, fallback is RDF/XML



modelToString
public static String modelToString(Model model)(Code)
convert a model to a string RDF/XML for serialization
Parameters:
  model - the model to convert



modelToString
public static String modelToString(ModelSet modelset)(Code)



modelToString
public static String modelToString(Model model, Syntax syntax)(Code)
convert a model to a string for serialization
Parameters:
  model - the model to convert
Parameters:
  syntax - the syntax to use a string of this model, according to the passed syntax



modelToString
public static String modelToString(ModelSet modelset, Syntax syntax)(Code)
convert a modelset to a string for serialization
Parameters:
  modelset - the model to convert
Parameters:
  syntax - the syntax to use a string of this model, according to the passed syntax



setSingleValue
public static void setSingleValue(Model m, Resource res, URI pred, Node value)(Code)
set the property pred of the resource res. If it exists, change it. If it not exists, create it. If the passed value is null, delete the statement
Parameters:
  m - the model to manipulate
Parameters:
  res - the rsource
Parameters:
  pred - the predicate to set
Parameters:
  value - a value or null



setSingleValue
public static void setSingleValue(Model m, Resource res, URI pred, String value)(Code)
set the property pred of the resource res. If it exists, change it. If it not exists, create it. If value is null, delete the triple.
Parameters:
  m - the model to manipulate
Parameters:
  res - the rsource
Parameters:
  pred - the predicate to set
Parameters:
  value - a string or null



sha1sum
public static String sha1sum(String data)(Code)
compute the sha1sum of a string (useful for handling FOAF data).
Parameters:
  data - the string to parse the sha1sum as string.



string2Date
public static Date string2Date(String isodate) throws ParseException(Code)
try to get a date out of a string. If this works, return it, otherwise return null. Btw: the namespace of dateTime is http://www.w3.org/2001/XMLSchema#dateTime Timezone is ignored.
Parameters:
  isodate - the XSD date as string. a parsed date or null, if this breaks
throws:
  ParseException -



string2DateTime
public static Date string2DateTime(String date) throws ParseException(Code)
format the given date in a good date format: ISO 8601, using only the date and not the T seperator example: 2003-01-22 This ignores timezones.
Parameters:
  date - the date-string to parse a formatted string.



stringToModel
public static Model stringToModel(String rdfxml)(Code)
convenience function to create a memModel from an RDF/XML-ABBREV stream
Parameters:
  rdfxml - the serialized form of the model a Model



stringToModel
public static Model stringToModel(String string, Syntax syntax)(Code)
convenience function to create a memModel from a string
Parameters:
  string - the string with the serialized model
Parameters:
  syntax - the syntax to use the model that was serialised.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.