commonsrdf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r948913 - in /websites/production/commonsrdf/content: contributing.html download.html examples.html index.html mail-lists.html project-info.html project-reports.html source-repository.html team-list.html
Date Thu, 23 Apr 2015 16:10:20 GMT
Author: stain
Date: Thu Apr 23 16:10:20 2015
New Revision: 948913

Log:
Site checkin for project Commons RDF

Added:
    websites/production/commonsrdf/content/examples.html
Modified:
    websites/production/commonsrdf/content/contributing.html
    websites/production/commonsrdf/content/download.html
    websites/production/commonsrdf/content/index.html
    websites/production/commonsrdf/content/mail-lists.html
    websites/production/commonsrdf/content/project-info.html
    websites/production/commonsrdf/content/project-reports.html
    websites/production/commonsrdf/content/source-repository.html
    websites/production/commonsrdf/content/team-list.html

Modified: websites/production/commonsrdf/content/contributing.html
==============================================================================
--- websites/production/commonsrdf/content/contributing.html (original)
+++ websites/production/commonsrdf/content/contributing.html Thu Apr 23 16:10:20 2015
@@ -82,6 +82,10 @@
     API</a>
   				</li>
  														<li class="none">
+		              <a href="examples.html" title="Examples">
+    Examples</a>
+  				</li>
+ 														<li class="none">
 		              <a href="download.html" title="Download">
     Download</a>
   				</li>

Modified: websites/production/commonsrdf/content/download.html
==============================================================================
--- websites/production/commonsrdf/content/download.html (original)
+++ websites/production/commonsrdf/content/download.html Thu Apr 23 16:10:20 2015
@@ -81,6 +81,10 @@
 		              <a href="apidocs/index.html?org/apache/commons/rdf/api/package-summary.html"
title="API">
     API</a>
   				</li>
+ 														<li class="none">
+		              <a href="examples.html" title="Examples">
+    Examples</a>
+  				</li>
  															<li class="none active">
 		              <a href="download.html" title="Download">
     Download</a>

Added: websites/production/commonsrdf/content/examples.html
==============================================================================
--- websites/production/commonsrdf/content/examples.html (added)
+++ websites/production/commonsrdf/content/examples.html Thu Apr 23 16:10:20 2015
@@ -0,0 +1,337 @@
+<!DOCTYPE html>
+<!--
+ | Generated by Apache Maven Doxia at 23 April 2015
+ | Rendered using Apache Maven Fluido Skin 1.3.0
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+  <head>
+    <meta charset="UTF-8" />
+    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+    <meta name="Date-Revision-yyyymmdd" content="20150423" />
+    <meta http-equiv="Content-Language" content="en" />
+    <title>Apache Commons RDF &#x2013; Examples of using the Commons RDF API</title>
+
+	<link rel="stylesheet" href="./css/bootstrap.min.css" type="text/css" />
+	<link rel="stylesheet" href="./css/site.css" type="text/css" />
+    <link rel="stylesheet" href="./css/print.css" media="print" />
+
+	<script type="text/javascript" src="./js/jquery.min.js"></script>
+	<script type="text/javascript" src="./js/bootstrap.min.js"></script>
+	<script type="text/javascript" src="./js/prettify.min.js"></script>
+	<script type="text/javascript" src="./js/site.js"></script>
+
+                            
+<link rel="stylesheet" href="./css/prettify.css" media="all" type="text/css"/>    
                           
+<script src="./js/prettify.js" type="text/javascript"></script>             
                  
+<script type="text/javascript">window.onload=function() {
+              prettyPrint();
+          }</script>                  
+      </head>
+
+	<body class="composite">
+                                        <a href="./" id="bannerLeft" title="Apache Commons
RDF logo">
+                                                                                        
       <img class="logo-left" src="images/commonsrdf-logo.png"  alt="Apache Commons RDF
logo"/>
+                </a>
+                		<div class="clear"></div>
+
+		<div class="navbar">
+			<div class="navbar-inner">
+				<div class="container-fluid">
+					<a class="brand" href="http://commonsrdf.incubator.apache.org">Commons RDF &trade;</a>
+					<ul class="nav">      
+                    
+            <li id="publishDate">Last Published: 23 April 2015</li>
+      <li class="divider">|</li> <li id="projectVersion">Version: 0.1.0-incubating-SNAPSHOT</li>
+  </ul>
+                    <div class="pull-right">	<ul class="nav">
+						<li>
+		              <a href="http://www.apachecon.com/" class="externalLink" title="ApacheCon">
+    ApacheCon</a>
+  		</li>
+					<li>
+		              <a href="http://www.apache.org" class="externalLink" title="Apache">
+    Apache</a>
+  		</li>
+					<li>
+		              <a href="http://commons.apache.org/" class="externalLink" title="Commons">
+    Commons</a>
+  		</li>
+					<li>
+		              <a href="http://incubator.apache.org/" class="externalLink" title="Incubator">
+    Incubator</a>
+  		</li>
+		</ul>
+</div>
+				</div>
+			</div>
+		</div>
+
+		<div class="container-fluid">
+			<table class="layout-table">
+				<tr>
+					<td class="sidebar">
+						<div class="well sidebar-nav">
+										<ul class="nav nav-list">
+		 		            						 <li class="nav-header">Project</li>
+																				<li class="none">
+		              <a href="index.html" title="Home">
+    Home</a>
+  				</li>
+ 														<li class="none">
+		              <a href="apidocs/index.html?org/apache/commons/rdf/api/package-summary.html"
title="API">
+    API</a>
+  				</li>
+ 															<li class="none active">
+		              <a href="examples.html" title="Examples">
+    Examples</a>
+  				</li>
+ 														<li class="none">
+		              <a href="download.html" title="Download">
+    Download</a>
+  				</li>
+ 														<li class="none">
+		              <a href="contributing.html" title="Contributing">
+    Contributing</a>
+  				</li>
+ 														<li class="none">
+		              <a href="team-list.html" title="Team">
+    Team</a>
+  				</li>
+ 								</ul>
+			<ul class="nav nav-list">
+		 		            						 <li class="nav-header">Tools</li>
+																				<li class="none">
+		              <a href="mail-lists.html" title="Mailing Lists">
+    Mailing Lists</a>
+  				</li>
+ 														<li class="none">
+		              <a href="https://git-wip-us.apache.org/repos/asf/incubator-commonsrdf.git"
class="externalLink" title="Source (Git)">
+    Source (Git)</a>
+  				</li>
+ 														<li class="none">
+		              <a href="https://issues.apache.org/jira/browse/COMMONSRDF" class="externalLink"
title="Issues (Jira)">
+    Issues (Jira)</a>
+  				</li>
+ 								</ul>
+			<ul class="nav nav-list">
+		 		            									 <li class="nav-header"><i class="icon-info-sign"></i>Project
Documentation</li>
+																								                                                              		
					<li class="collapsed">
+		              <a href="project-info.html" title="Project Information">
+    Project Information</a>
+  									</li>
+ 																		                                            								<li class="collapsed">
+		              <a href="project-reports.html" title="Project Reports">
+    Project Reports</a>
+  									</li>
+ 								</ul>
+			<ul class="nav nav-list">
+		 		            						 <li class="nav-header">Commons</li>
+																				<li class="none">
+		              <a href="http://commons.apache.org/" class="externalLink" title="Home">
+    Home</a>
+  				</li>
+ 														<li class="none">
+		              <a href="http://www.apache.org/licenses/" class="externalLink" title="License">
+    License</a>
+  				</li>
+ 																		                          								<li class="collapsed">
+		              <a href="http://commons.apache.org/components.html" class="externalLink"
title="Components">
+    Components</a>
+  									</li>
+ 																		                          								<li class="collapsed">
+		              <a href="http://commons.apache.org/sandbox/index.html" class="externalLink"
title="Sandbox">
+    Sandbox</a>
+  									</li>
+ 																		                          								<li class="collapsed">
+		              <a href="http://commons.apache.org/dormant/index.html" class="externalLink"
title="Dormant">
+    Dormant</a>
+  									</li>
+ 								</ul>
+			<ul class="nav nav-list">
+		 		            						 <li class="nav-header">General Information</li>
+																				<li class="none">
+		              <a href="security.html" title="Security">
+    Security</a>
+  				</li>
+ 														<li class="none">
+		              <a href="http://commons.apache.org/volunteering.html" class="externalLink"
title="Volunteering">
+    Volunteering</a>
+  				</li>
+ 														<li class="none">
+		              <a href="http://commons.apache.org/patches.html" class="externalLink"
title="Contributing Patches">
+    Contributing Patches</a>
+  				</li>
+ 														<li class="none">
+		              <a href="http://commons.apache.org/building.html" class="externalLink"
title="Building Components">
+    Building Components</a>
+  				</li>
+ 														<li class="none">
+		              <a href="http://commons.apache.org/commons-parent-pom.html" class="externalLink"
title="Commons Parent Pom">
+    Commons Parent Pom</a>
+  				</li>
+ 														<li class="none">
+		              <a href="http://commons.apache.org/build-plugin/index.html" class="externalLink"
title="Commons Build Plugin">
+    Commons Build Plugin</a>
+  				</li>
+ 														<li class="none">
+		              <a href="http://commons.apache.org/releases/index.html" class="externalLink"
title="Releasing Components">
+    Releasing Components</a>
+  				</li>
+ 														<li class="none">
+		              <a href="http://wiki.apache.org/commons/FrontPage" class="externalLink"
title="Wiki">
+    Wiki</a>
+  				</li>
+ 								</ul>
+			<ul class="nav nav-list">
+		 		            						 <li class="nav-header">ASF</li>
+																				<li class="none">
+		              <a href="http://www.apache.org/foundation/how-it-works.html" class="externalLink"
title="How the ASF works">
+    How the ASF works</a>
+  				</li>
+ 														<li class="none">
+		              <a href="http://www.apache.org/foundation/getinvolved.html" class="externalLink"
title="Get Involved">
+    Get Involved</a>
+  				</li>
+ 														<li class="none">
+		              <a href="http://www.apache.org/dev/" class="externalLink" title="Developer
Resources">
+    Developer Resources</a>
+  				</li>
+ 														<li class="none">
+		              <a href="http://www.apache.org/foundation/sponsorship.html" class="externalLink"
title="Sponsorship">
+    Sponsorship</a>
+  				</li>
+ 														<li class="none">
+		              <a href="http://www.apache.org/foundation/thanks.html" class="externalLink"
title="Thanks">
+    Thanks</a>
+  				</li>
+ 								</ul>
+							</div>
+						<div id="poweredBy">
+							                                                                                 
                    <a href="http://www.apache.org/events/current-event.html" title="ApacheCon"
class="builtBy">
+        <img class="builtBy"  alt="ApacheCon" src="http://www.apache.org/events/current-event-125x125.png"
   />
+      </a>
+                                                                                        
           <a href="http://maven.apache.org/" title="Maven" class="builtBy">
+        <img class="builtBy"  alt="Maven" src="http://maven.apache.org/images/logos/maven-feather.png"
   />
+      </a>
+          						</div>
+					</td>
+					<td class="content">
+						<h1>Examples of using the Commons RDF API</h1>
+<p>This page shows some examples of a client using the Commons RDF API.</p>
+<div class="section">
+<h2><a name="Using_Commons_RDF_from_Maven"></a>Using Commons RDF from Maven</h2>
+<p>To use Commons RDF API from an <a class="externalLink" href="http://maven.apache.org/">Apache
Maven</a> projects, add the following dependency to your <tt>pom.xml</tt>:</p>
+
+<div class="source">
+<div class="source">
+<pre>&lt;dependencies&gt;
+    &lt;dependency&gt;
+        &lt;groupId&gt;org.apache.commons&lt;/groupId&gt;
+        &lt;artifactId&gt;commons-rdf-api&lt;/artifactId&gt;
+        &lt;version&gt;0.1-incubating-SNAPSHOT&lt;/version&gt;
+    &lt;/dependency&gt;
+&lt;/dependencies&gt;
+</pre></div></div>
+<p>If you are using a <tt>SNAPSHOT</tt> version, then you will have to
either build Commons RDF from <a class="externalLink" href="https://github.com/apache/incubator-commonsrdf">source</a>,
or add the <a class="externalLink" href="https://github.com/apache/incubator-commonsrdf#snapshot-repository">snapshot
repository</a></p>
+<p>In the examples below we will use the <a href="apidocs/org/apache/commons/rdf/simple/package-summary.html"><tt>simple</tt>
implementation</a>, but the examples should be equally applicable to other implementations.
To add a dependency for the <tt>simple</tt> implementation, add to your <tt>pom.xml</tt>
section <tt>&lt;dependencies&gt;</tt>: </p>
+
+<div class="source">
+<div class="source">
+<pre>    &lt;dependency&gt;
+        &lt;groupId&gt;org.apache.commons&lt;/groupId&gt;
+        &lt;artifactId&gt;commons-rdf-simple&lt;/artifactId&gt;
+        &lt;version&gt;0.1.0-incubating-SNAPSHOT&lt;/version&gt;
+    &lt;/dependency&gt;
+</pre></div></div></div>
+<div class="section">
+<h2><a name="RDFTermFactory"></a>RDFTermFactory</h2>
+<p>To create instances of Commons RDF interfaces like <a href="apidocs/org/apache/commons/rdf/api/Graph.html"><tt>Graph</tt></a>
and <a href="apidocs/org/apache/commons/rdf/api/IRI.html"><tt>IRI</tt></a>
you will need a <a href="/apidocs/org/apache/commons/rdf/api/RDFTermFactory.html">RDFTermFactory</a>.</p>
+<p>How to get an instance of this factory is implementation specific, for the <tt>simple</tt>
implementation, you can construct the <a href="apidocs/org/apache/commons/rdf/simple/SimpleRDFTermFactory.html">SimpleRDFTermFactory</a>:</p>
+
+<div class="source">
+<div class="source">
+<pre>import org.apache.commons.rdf.api.RDFTermFactory;
+import org.apache.commons.rdf.simple.SimpleRDFTermFactory;
+// ..
+RDFTermFactory rdfTermFactory = new SimpleRDFTermFactory();
+</pre></div></div>
+<p>Using the factory you can create any <a href="apidocs/org/apache/commons/rdf/api/RDFTerm.html">RDFTerm</a>,
e.g. to create a <a href="apidocs/org/apache/commons/rdf/api/BlankNode.html">BlankNode</a>,
<a href="apidocs/org/apache/commons/rdf/api/IRI.html">IRI</a> and <a href="apidocs/org/apache/commons/rdf/api/Literal.html">Literal</a>:</p>
+
+<div class="source">
+<div class="source">
+<pre>BlankNode blankNode = factory.createBlankNode();
+IRI iri = factory.createIRI(&quot;http://example.com/name&quot;);
+Literal literal = factory.createLiteral(&quot;Alice&quot;);
+</pre></div></div>
+<p>You can also create a stand-alone <a href="apidocs/org/apache/commons/rdf/api/Triple.html">Triple</a>:</p>
+
+<div class="source">
+<div class="source">
+<pre>Triple triple = factory.createTriple(blankNode, iri, literal);
+</pre></div></div>
+<p>To keep your triples, you might want a <a href="apidocs/org/apache/commons/rdf/api/Graph.html">Graph</a>:</p>
+
+<div class="source">
+<div class="source">
+<pre>Graph graph = factory.createGraph();
+</pre></div></div>
+<p>The <a href="apidocs/org/apache/commons/rdf/api/RDFTermFactory.html">RDFTermFactory</a>
also contains more specific variants of some of the methods above, e.g. to create a typed
literal. </p>
+<p>Note that for any given implementation, <tt>RDFTerm</tt> instances need
not be created using a <tt>RDFTermFactory</tt>. More likely, implementation-specific
methods might create these objects as part of data parsing, storage lookup and queries.</p></div>
+<div class="section">
+<h2><a name="Graph"></a>Graph</h2>
+<p>A <a href="apidocs/org/apache/commons/rdf/api/Graph.html">Graph</a>
is a collection of <a href="apidocs/org/apache/commons/rdf/api/Triple.html">Triple</a>s.</p>
+<p>Given the <a href="#RDFTermFactory">previous example</a>, we can <a
href="apidocs/org/apache/commons/rdf/api/Graph.html#add-org.apache.commons.rdf.api.Triple-">add</a>
the <tt>triple</tt> to the <tt>graph</tt>:</p>
+
+<div class="source">
+<div class="source">
+<pre>graph.add(triple);
+</pre></div></div>
+<p>And check that the graph <a href="apidocs/org/apache/commons/rdf/api/Graph.html#contains-org.apache.commons.rdf.api.Triple-">contains</a>
the triple:</p>
+
+<div class="source">
+<div class="source">
+<pre>System.out.println(graph.contains(triple));
+</pre></div></div>
+
+<blockquote>
+<p>true</p>
+</blockquote>
+<p>As an alternative you can also use the expanded form of these methods:</p>
+
+<div class="source">
+<div class="source">
+<pre>IRI bob = factory.createIRI(&quot;http://example.com/bob&quot;);
+Literal bobName = factory.createLiteral(&quot;Bob&quot;);
+graph.add(bob, iri, bobName);
+</pre></div></div>
+<p>and</p>
+
+<div class="source">
+<div class="source">
+<pre>System.out.println(graph.contains(null, iri, bobName));
+</pre></div></div>
+
+<blockquote>
+<p>true</p>
+</blockquote>
+<p>Notice that the expanded <a href="apidocs/org/apache/commons/rdf/api/Graph.html#contains-org.apache.commons.rdf.api.BlankNodeOrIRI-org.apache.commons.rdf.api.IRI-org.apache.commons.rdf.api.RDFTerm-">Graph.contains()</a>
allow <tt>null</tt> as a wildcard parameters.</p>
+<p><b>TODO:</b> Remaining Graph operations, incl. <tt>getTriples()</tt>
streams</p>
+<p><b>TODO:</b> <a href="apidocs/org/apache/commons/rdf/simple/Types.html">Types</a></p>
+<p><b>TODO:</b> Methods on <tt>Literal</tt>, <tt>IRI</tt>,
<tt>BlankNode</tt> etc.</p>
+<p><b>TODO:</b> Serialize as n-triples example</p></div>
+					</td>
+				</tr>
+			</table>
+		</div>
+
+		<div class="footer">
+			<p>Copyright &copy;                    2015
+                        <a href="http://www.apache.org/">The Apache Software Foundation</a>.
+            All Rights Reserved.</p>
+                                                          				
+<div class="center">Apache Commons, Apache, the Apache feather logo, and the Apache
Commons project logos are trademarks of The Apache Software Foundation.
+      All other marks mentioned may be trademarks or registered trademarks of their respective
owners.</div>
+                          		</div>
+	</body>
+
+</html>
\ No newline at end of file

Modified: websites/production/commonsrdf/content/index.html
==============================================================================
--- websites/production/commonsrdf/content/index.html (original)
+++ websites/production/commonsrdf/content/index.html Thu Apr 23 16:10:20 2015
@@ -82,6 +82,10 @@
     API</a>
   				</li>
  														<li class="none">
+		              <a href="examples.html" title="Examples">
+    Examples</a>
+  				</li>
+ 														<li class="none">
 		              <a href="download.html" title="Download">
     Download</a>
   				</li>
@@ -258,7 +262,8 @@
   
 <li><a href="apidocs/index.html?org/apache/commons/rdf/api/RDFTermFactory.html">RDFTermFactory</a>:
 factory for creating <tt>RDFTerm</tt> and <tt>Graph</tt> instances.</li>
 </ul>
-<p>The design of the <a href="apidocs/index.html?org/apache/commons/rdf/api/package-summary.html">API</a>
follows the terminology as defined by <a class="externalLink" href="http://www.w3.org/TR/rdf11-concepts/">RDF
1.1 Concepts and Abstract Syntax</a>, a W3C Recommendation published on 25 February
2014. The idea is that Commons RDF will provide a common library for RDF 1.1 that could be
implemented by systems on the Java Virtual Machine, allowing the portability across different
implementations.</p></div>
+<p>The design of the <a href="apidocs/index.html?org/apache/commons/rdf/api/package-summary.html">API</a>
follows the terminology as defined by <a class="externalLink" href="http://www.w3.org/TR/rdf11-concepts/">RDF
1.1 Concepts and Abstract Syntax</a>, a W3C Recommendation published on 25 February
2014. The idea is that Commons RDF will provide a common library for RDF 1.1 that could be
implemented by systems on the Java Virtual Machine, allowing the portability across different
implementations.</p>
+<p>See the <a href="examples.html">examples</a> for how to interact with
these interfaces.</p></div>
 <div class="section">
 <h2><a name="Modules"></a>Modules</h2>
 <p>The project is actually composed by two modules:</p>

Modified: websites/production/commonsrdf/content/mail-lists.html
==============================================================================
--- websites/production/commonsrdf/content/mail-lists.html (original)
+++ websites/production/commonsrdf/content/mail-lists.html Thu Apr 23 16:10:20 2015
@@ -82,6 +82,10 @@
     API</a>
   				</li>
  														<li class="none">
+		              <a href="examples.html" title="Examples">
+    Examples</a>
+  				</li>
+ 														<li class="none">
 		              <a href="download.html" title="Download">
     Download</a>
   				</li>

Modified: websites/production/commonsrdf/content/project-info.html
==============================================================================
--- websites/production/commonsrdf/content/project-info.html (original)
+++ websites/production/commonsrdf/content/project-info.html Thu Apr 23 16:10:20 2015
@@ -82,6 +82,10 @@
     API</a>
   				</li>
  														<li class="none">
+		              <a href="examples.html" title="Examples">
+    Examples</a>
+  				</li>
+ 														<li class="none">
 		              <a href="download.html" title="Download">
     Download</a>
   				</li>

Modified: websites/production/commonsrdf/content/project-reports.html
==============================================================================
--- websites/production/commonsrdf/content/project-reports.html (original)
+++ websites/production/commonsrdf/content/project-reports.html Thu Apr 23 16:10:20 2015
@@ -82,6 +82,10 @@
     API</a>
   				</li>
  														<li class="none">
+		              <a href="examples.html" title="Examples">
+    Examples</a>
+  				</li>
+ 														<li class="none">
 		              <a href="download.html" title="Download">
     Download</a>
   				</li>

Modified: websites/production/commonsrdf/content/source-repository.html
==============================================================================
--- websites/production/commonsrdf/content/source-repository.html (original)
+++ websites/production/commonsrdf/content/source-repository.html Thu Apr 23 16:10:20 2015
@@ -82,6 +82,10 @@
     API</a>
   				</li>
  														<li class="none">
+		              <a href="examples.html" title="Examples">
+    Examples</a>
+  				</li>
+ 														<li class="none">
 		              <a href="download.html" title="Download">
     Download</a>
   				</li>

Modified: websites/production/commonsrdf/content/team-list.html
==============================================================================
--- websites/production/commonsrdf/content/team-list.html (original)
+++ websites/production/commonsrdf/content/team-list.html Thu Apr 23 16:10:20 2015
@@ -82,6 +82,10 @@
     API</a>
   				</li>
  														<li class="none">
+		              <a href="examples.html" title="Examples">
+    Examples</a>
+  				</li>
+ 														<li class="none">
 		              <a href="download.html" title="Download">
     Download</a>
   				</li>



Mime
View raw message