http://git-wip-us.apache.org/repos/asf/polygene-website/blob/ba3a0fac/content/java/develop/extension-es-riak.html ---------------------------------------------------------------------- diff --git a/content/java/develop/extension-es-riak.html b/content/java/develop/extension-es-riak.html new file mode 100644 index 0000000..ac02c2a --- /dev/null +++ b/content/java/develop/extension-es-riak.html @@ -0,0 +1,234 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Riak EntityStore</title><link rel="stylesheet" type="text/css" href="css/style.css" /><meta name="generator" content="DocBook XSL Stylesheets V1.76.1" /><link rel="home" href="index.html" title="" /><link rel="up" href="extensions.html" title="Extensions" /><link rel="prev" href="extension-es-redis.html" title="Redis EntityStore" /><link rel="next" href="extension-es-sql.html" title="SQL EntityStore" /> + + +<!-- favicon --> + +<link rel="shortcut icon" href="http://polygene.apache.org/favicon.ico" type="image/vnd.microsoft.icon" /> +<link rel="icon" href="http://polygene.apache.org/favicon.ico" type="image/x-icon" /> + +<!-- style --> + +<link href="css/shCore.css" rel="stylesheet" type="text/css" /> +<link href="css/shCoreEclipse.css" rel="stylesheet" type="text/css" /> +<link href="css/shThemeEclipse.css" rel="stylesheet" type="text/css" /> +<link href="css/polygene.css" rel="stylesheet" type="text/css" /> + +<!-- Syntax Highlighter --> + +<script type="text/javascript" src="js/shCore.js"></script> +<script type="text/javascript" src="js/shBrushJava.js"></script> +<script type="text/javascript" src="js/shBrushScala.js"></script> +<script type="text/javascript" src="js/shBrushJScript.js"></script> +<script type="text/javascript" src="js/shBrushBash.js"></script> +<script type="text/javascript" src="js/shBrushPlain.js"></script> +<script type="text/javascript" src="js/shBrushXml.js"></script> +<script type="text/javascript" src="js/shBrushGroovy.js"></script> +<script type="text/javascript" src="js/shBrushPython.js"></script> +<script type="text/javascript" src="js/shBrushRuby.js"></script> +<script type="text/javascript" src="js/shBrushCSharp.js"></script> + +<script type="text/javascript"> + SyntaxHighlighter.defaults['tab-size'] = 4; + SyntaxHighlighter.defaults['gutter'] = false; + SyntaxHighlighter.defaults['toolbar'] = false; + SyntaxHighlighter.all() +</script> + +<!-- JQuery --> + +<script type="text/javascript" src="js/jquery-1.6.4.min.js"></script> + +<!-- Image Scaler --> + +<script type="text/javascript" src="js/imagescaler.js"></script> + +<!-- Table Styler --> + +<script type="text/javascript" src="js/tablestyler.js"></script> + +<!-- Apache Polygene WebSite Progressive Enhancement --> + +<link href="css/progressive-enhancement.css" rel="stylesheet" type="text/css" /> +<script type="text/javascript" src="js/jquery.scrollTo-1.4.2.js"></script> +<script type="text/javascript" src="js/progressive-enhancement.js"></script> + +<!-- Analytics --> + <script type="text/javascript"> + var _gaq = _gaq || []; + _gaq.push(['_setAccount', 'UA-62007352-1']); + _gaq.push(['_trackPageview']); + + (function() { + var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; + ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; + var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); + })(); + </script> + + </head><body><div xmlns="" xmlns:exsl="http://exslt.org/common" class="logo"><a href="index.html"><img src="images/logo-standard.png" /></a></div><div xmlns="" xmlns:exsl="http://exslt.org/common" class="top-nav"><div xmlns="http://www.w3.org/1999/xhtml" class="toc"><dl><dt><span class="section"><a href="index.html#home">Polygeneâ¢</a></span></dt><dt><span class="section"><a href="intro.html">Introduction</a></span></dt><dt><span class="section"><a href="tutorials.html">Tutorials</a></span></dt><dt><span class="section"><a href="javadocs.html">Javadoc</a></span></dt><dt><span class="section"><a href="samples.html">Samples</a></span></dt><dt><span class="section"><a href="core.html">Core</a></span></dt><dt><span class="section"><a href="libraries.html">Libraries</a></span></dt><dt><span class="section"><span xmlns="" href="extensions.html">Extensions</span></span></dt><dt><span class="section"><a href="tools.html">Tools</a></span></dt><dt><span class="section"><a href="glossary.ht ml">Glossary </a></span></dt></dl></div></div><div xmlns="" xmlns:exsl="http://exslt.org/common" class="sub-nav"><div xmlns="http://www.w3.org/1999/xhtml" class="toc"><dl><dt><span class="section"><a href="extensions.html#_overview_7">Overview</a></span></dt><dt><span class="section"><a href="extension-vs-orgjson.html">org.json ValueSerialization</a></span></dt><dt><span class="section"><a href="extension-vs-jackson.html">Jackson ValueSerialization</a></span></dt><dt><span class="section"><a href="extension-vs-stax.html">StAX ValueSerialization</a></span></dt><dt><span class="section"><a href="extension-cache-ehcache.html">Ehcache Cache</a></span></dt><dt><span class="section"><a href="extension-cache-memcache.html">Memcache Cache</a></span></dt><dt><span class="section"><a href="extension-es-memory.html">Memory EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-file.html">File EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-geode. html">Geode EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-hazelcast.html">Hazelcast EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-jclouds.html">JClouds EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-jdbm.html">JDBM EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-leveldb.html">LevelDB EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-mongodb.html">MongoDB EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-preferences.html">Preferences EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-redis.html">Redis EntityStore</a></span></dt><dt><span class="section"><span xmlns="" href="extension-es-riak.html">Riak EntityStore</span></span></dt><dt><span class="section"><a href="extension-es-sql.html">SQL EntityStore</a></span></dt><dt><span class="section"><a href="extension-index-elasticsearch.html">ElasticSear ch Index/Query</a></span></dt><dt><span class="section"><a href="extension-index-rdf.html">OpenRDF Index/Query</a></span></dt><dt><span class="section"><a href="extension-index-solr.html">Apache Solr Index/Query</a></span></dt><dt><span class="section"><a href="extension-indexing-sql.html">SQL Index/Query</a></span></dt><dt><span class="section"><a href="extension-metrics-metrics.html">Codahale Metrics</a></span></dt><dt><span class="section"><a href="extension-migration.html">Migration</a></span></dt><dt><span class="section"><a href="extension-reindexer.html">Reindexer</a></span></dt></dl></div></div><div class="section" title="Riak EntityStore"><div class="titlepage"><div><div><h3 class="title"><a id="extension-es-riak"></a>Riak EntityStore</h3></div></div></div><p class="remark"><em><span class="comment"></span></em></p><p class="devstatus-code-beta">code</p><p class="devstatus-docs-good">docs</p><p class="devstatus-tests-good">tests</p><p>EntityStore service backed by a <a clas s="ulink" href="http://basho.com/" target="_top">Riak</a> bucket.</p><p>The EntityStore only supports accessing Riak using protocol buffers. +HTTP is not supported since the 2.x serie of the Riak Java client. +See the Riak documentation.</p><div class="section" title="Assembly"><div class="titlepage"><div><div><h4 class="title"><a id="_assembly_20"></a>Assembly</h4></div></div></div><p>Assembly is done using the provided Assembler:</p><pre class="programlisting brush: java">public void assemble( ModuleAssembly module ) + throws AssemblyException +{ + [...snip...] + + new RiakEntityStoreAssembler().withConfig( config, Visibility.layer ).assemble( module ); +} +</pre></div><div class="section" title="Configuration"><div class="titlepage"><div><div><h4 class="title"><a id="_configuration_13"></a>Configuration</h4></div></div></div><p>Here are the available configuration properties:</p><pre class="programlisting brush: java">public interface RiakEntityStoreConfiguration extends ConfigurationComposite +{ + /** + * List of Riak Protocol Buffer hosts. + * + * Each entry can contain either an IP address / hostname + * or an IP address / hostname followed by a column and the host's port. + * + * Defaulted to 127.0.0.1 if empty. + * + * @return List of Riak nodes + */ + @UseDefaults + Property<List<String>> hosts(); + + /** + * User name to use for authentication. + * + * @return Authentication user name + */ + @Optional + Property<String> username(); + + /** + * Password to use for authentication. + * + * @return Authentication password + */ + @Optional + Property<String> password(); + + /** + * Type of the keystore used for server certificate authentication. + * + * @return Type of the keystore used for server certificate authentication + */ + @Optional + @OneOf( { "PKCS12", "JCEKS", "JKS" } ) + Property<String> truststoreType(); + + /** + * Path of the keystore used for server certificate authentication. + * + * @return Path of the keystore used for server certificate authentication + */ + @Optional + Property<String> truststorePath(); + + /** + * Password of the keystore used for server certificate authentication. + * + * @return Password of the keystore used for server certificate authentication + */ + @Optional + Property<String> truststorePassword(); + + /** + * Type of the keystore used for client certificate authentication. + * + * @return Type of the keystore used for client certificate authentication + */ + @Optional + @OneOf( { "PKCS12", "JCEKS", "JKS" } ) + Property<String> keystoreType(); + + /** + * Path of the keystore used for client certificate authentication. + * + * @return Path of the keystore used for client certificate authentication + */ + @Optional + Property<String> keystorePath(); + + /** + * Password of the keystore used for client certificate authentication. + * + * @return Password of the keystore used for client certificate authentication + */ + @Optional + Property<String> keystorePassword(); + + /** + * Password of the key used for client certificate authentication. + * + * @return Password of the key used for client certificate authentication + */ + @Optional + Property<String> keyPassword(); + + /** + * Riak Bucket where Entities state will be stored. + * + * Defaulted to "polygene:entities". + * + * @return Riak bucket name + */ + @UseDefaults( "polygene:entities" ) + Property<String> bucket(); + + /** + * Cluster execution attempts. + * + * @return Cluster execution attempts + */ + @Optional + Property<Integer> clusterExecutionAttempts(); + + /** + * Minimum connections per node. + * + * @return Minimum connections per node + */ + @Optional + Property<Integer> minConnections(); + + /** + * Maximum connections per node. + * + * @return Maximum connections per node + */ + @Optional + Property<Integer> maxConnections(); + + /** + * Block on maximum connections. + * + * @return Block on maximum connections + */ + @UseDefaults + Property<Boolean> blockOnMaxConnections(); + + /** + * Connection timeout. + * + * @return Connection timeout + */ + @Optional + Property<Integer> connectionTimeout(); + + /** + * Idle timeout. + * + * @return idle timeout + */ + @Optional + Property<Integer> idleTimeout(); +} +</pre><p>All authentication related properties are optional. +By default no authentication is used. +As soon as you provide a <code class="literal">username</code>, authentication is set up. +Please note that you should then at least provide <code class="literal">truststoreType</code>, <code class="literal">truststorePath</code> and <code class="literal">truststorePassword</code>. +To use client certificate authentication, set <code class="literal">keystoreType</code>, <code class="literal">keystorePath</code>, <code class="literal">keystorePassword</code> and <code class="literal">keyPassword</code>.</p></div></div><div xmlns="" xmlns:exsl="http://exslt.org/common" class="footer"><p> + Copyright © 2015 The Apache Software Foundation, Licensed under the <a href="http://www.apache.org/licenses/" target="_blank">Apache License, Version 2.0</a>. + <br /><small> + Apache Polygene, Polygene, Apache, the Apache feather logo, and the Apache Polygene project logo are trademarks of The Apache Software Foundation.<br /> + All other marks mentioned may be trademarks or registered trademarks of their respective owners. + </small></p></div></body></html> \ No newline at end of file
http://git-wip-us.apache.org/repos/asf/polygene-website/blob/ba3a0fac/content/java/develop/extension-es-sql.html ---------------------------------------------------------------------- diff --git a/content/java/develop/extension-es-sql.html b/content/java/develop/extension-es-sql.html new file mode 100644 index 0000000..2cc1264 --- /dev/null +++ b/content/java/develop/extension-es-sql.html @@ -0,0 +1,341 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>SQL EntityStore</title><link rel="stylesheet" type="text/css" href="css/style.css" /><meta name="generator" content="DocBook XSL Stylesheets V1.76.1" /><link rel="home" href="index.html" title="" /><link rel="up" href="extensions.html" title="Extensions" /><link rel="prev" href="extension-es-riak.html" title="Riak EntityStore" /><link rel="next" href="extension-index-elasticsearch.html" title="ElasticSearch Index/Query" /> + + +<!-- favicon --> + +<link rel="shortcut icon" href="http://polygene.apache.org/favicon.ico" type="image/vnd.microsoft.icon" /> +<link rel="icon" href="http://polygene.apache.org/favicon.ico" type="image/x-icon" /> + +<!-- style --> + +<link href="css/shCore.css" rel="stylesheet" type="text/css" /> +<link href="css/shCoreEclipse.css" rel="stylesheet" type="text/css" /> +<link href="css/shThemeEclipse.css" rel="stylesheet" type="text/css" /> +<link href="css/polygene.css" rel="stylesheet" type="text/css" /> + +<!-- Syntax Highlighter --> + +<script type="text/javascript" src="js/shCore.js"></script> +<script type="text/javascript" src="js/shBrushJava.js"></script> +<script type="text/javascript" src="js/shBrushScala.js"></script> +<script type="text/javascript" src="js/shBrushJScript.js"></script> +<script type="text/javascript" src="js/shBrushBash.js"></script> +<script type="text/javascript" src="js/shBrushPlain.js"></script> +<script type="text/javascript" src="js/shBrushXml.js"></script> +<script type="text/javascript" src="js/shBrushGroovy.js"></script> +<script type="text/javascript" src="js/shBrushPython.js"></script> +<script type="text/javascript" src="js/shBrushRuby.js"></script> +<script type="text/javascript" src="js/shBrushCSharp.js"></script> + +<script type="text/javascript"> + SyntaxHighlighter.defaults['tab-size'] = 4; + SyntaxHighlighter.defaults['gutter'] = false; + SyntaxHighlighter.defaults['toolbar'] = false; + SyntaxHighlighter.all() +</script> + +<!-- JQuery --> + +<script type="text/javascript" src="js/jquery-1.6.4.min.js"></script> + +<!-- Image Scaler --> + +<script type="text/javascript" src="js/imagescaler.js"></script> + +<!-- Table Styler --> + +<script type="text/javascript" src="js/tablestyler.js"></script> + +<!-- Apache Polygene WebSite Progressive Enhancement --> + +<link href="css/progressive-enhancement.css" rel="stylesheet" type="text/css" /> +<script type="text/javascript" src="js/jquery.scrollTo-1.4.2.js"></script> +<script type="text/javascript" src="js/progressive-enhancement.js"></script> + +<!-- Analytics --> + <script type="text/javascript"> + var _gaq = _gaq || []; + _gaq.push(['_setAccount', 'UA-62007352-1']); + _gaq.push(['_trackPageview']); + + (function() { + var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; + ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; + var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); + })(); + </script> + + </head><body><div xmlns="" xmlns:exsl="http://exslt.org/common" class="logo"><a href="index.html"><img src="images/logo-standard.png" /></a></div><div xmlns="" xmlns:exsl="http://exslt.org/common" class="top-nav"><div xmlns="http://www.w3.org/1999/xhtml" class="toc"><dl><dt><span class="section"><a href="index.html#home">Polygeneâ¢</a></span></dt><dt><span class="section"><a href="intro.html">Introduction</a></span></dt><dt><span class="section"><a href="tutorials.html">Tutorials</a></span></dt><dt><span class="section"><a href="javadocs.html">Javadoc</a></span></dt><dt><span class="section"><a href="samples.html">Samples</a></span></dt><dt><span class="section"><a href="core.html">Core</a></span></dt><dt><span class="section"><a href="libraries.html">Libraries</a></span></dt><dt><span class="section"><span xmlns="" href="extensions.html">Extensions</span></span></dt><dt><span class="section"><a href="tools.html">Tools</a></span></dt><dt><span class="section"><a href="glossary.ht ml">Glossary </a></span></dt></dl></div></div><div xmlns="" xmlns:exsl="http://exslt.org/common" class="sub-nav"><div xmlns="http://www.w3.org/1999/xhtml" class="toc"><dl><dt><span class="section"><a href="extensions.html#_overview_7">Overview</a></span></dt><dt><span class="section"><a href="extension-vs-orgjson.html">org.json ValueSerialization</a></span></dt><dt><span class="section"><a href="extension-vs-jackson.html">Jackson ValueSerialization</a></span></dt><dt><span class="section"><a href="extension-vs-stax.html">StAX ValueSerialization</a></span></dt><dt><span class="section"><a href="extension-cache-ehcache.html">Ehcache Cache</a></span></dt><dt><span class="section"><a href="extension-cache-memcache.html">Memcache Cache</a></span></dt><dt><span class="section"><a href="extension-es-memory.html">Memory EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-file.html">File EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-geode. html">Geode EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-hazelcast.html">Hazelcast EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-jclouds.html">JClouds EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-jdbm.html">JDBM EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-leveldb.html">LevelDB EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-mongodb.html">MongoDB EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-preferences.html">Preferences EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-redis.html">Redis EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-riak.html">Riak EntityStore</a></span></dt><dt><span class="section"><span xmlns="" href="extension-es-sql.html">SQL EntityStore</span></span></dt><dt><span class="section"><a href="extension-index-elasticsearch.html">ElasticSear ch Index/Query</a></span></dt><dt><span class="section"><a href="extension-index-rdf.html">OpenRDF Index/Query</a></span></dt><dt><span class="section"><a href="extension-index-solr.html">Apache Solr Index/Query</a></span></dt><dt><span class="section"><a href="extension-indexing-sql.html">SQL Index/Query</a></span></dt><dt><span class="section"><a href="extension-metrics-metrics.html">Codahale Metrics</a></span></dt><dt><span class="section"><a href="extension-migration.html">Migration</a></span></dt><dt><span class="section"><a href="extension-reindexer.html">Reindexer</a></span></dt></dl></div></div><div class="section" title="SQL EntityStore"><div class="titlepage"><div><div><h3 class="title"><a id="extension-es-sql"></a>SQL EntityStore</h3></div></div></div><p class="remark"><em><span class="comment"></span></em></p><p class="devstatus-code-stable">code</p><p class="devstatus-docs-good">docs</p><p class="devstatus-tests-good">tests</p><p>EntityStore service backed by a SQL data base.</p><p>This extension fully leverage the <a class="xref" href="library-sql.html" title="SQL">SQL Library</a> meaning that you must use it to assemble your DataSource and that you +get <a class="link" href="library-circuitbreaker.html" title="Circuit Breaker">Circuit Breaker</a> and <a class="link" href="library-jmx.html" title="JMX">JMX</a> integration for free.</p><div class="tip" title="Tip" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Tip</h3><p>See the <a class="xref" href="sample-sql-support.html" title="SQL Support Sample">SQL Support Sample</a> that demonstrate combined use of <a class="xref" href="library-sql.html" title="SQL">SQL Library</a>, <a class="xref" href="extension-es-sql.html" title="SQL EntityStore"> SQL EntityStore</a> and +<a class="xref" href="extension-indexing-sql.html" title="SQL Index/Query">SQL Index/Query</a>.</p></div><p>The following SQL databases are supported:</p><div class="itemizedlist"><ul class="itemizedlist"><li class="listitem"> +<a class="ulink" href="http://www.postgresql.org/" target="_top">PostgreSQL</a> +</li><li class="listitem"> +<a class="ulink" href="http://www.mysql.com/" target="_top">MySQL</a> and <a class="ulink" href="http://mariadb.org/" target="_top">MariaDB</a> +</li><li class="listitem"> +<a class="ulink" href="http://www.sqlite.org/" target="_top">SQLite</a> +</li><li class="listitem"> +<a class="ulink" href="http://www.h2database.com/" target="_top">H2 Database Engine</a> +</li><li class="listitem"> +<a class="ulink" href="http://db.apache.org/derby/" target="_top">Apache Derby</a> and <a class="ulink" href="http://www.oracle.com/technetwork/java/javadb/overview/index.htm" target="_top">Oracle JavaDB</a> +</li></ul></div><p>Each entity state is stored as a single row so maximum number of entities is the maximum number of rows per table +supported by the underlying SQL database.</p><p>Implementations per database Vendor share a generic codebase but can override about everything SQL. As a consequence +they can have strong differences in terms of performance if they use vendor specific extensions.</p><div class="section" title="Configuration"><div class="titlepage"><div><div><h4 class="title"><a id="_configuration_14"></a>Configuration</h4></div></div></div><p>SQL EntityStore Configuration is optional and provides only one configuration property: <code class="literal">schemaName</code> defaulted to +<span class="emphasis"><em>polygene_es</em></span>. On SQL databases that donât support schemas this configuration property is simply ignored.</p><p>The assembly snippets below show the DataSource assembly alongside the SQL EntityStore assembly. Remember to configure +the DataSource properly, see <a class="xref" href="library-sql.html" title="SQL">SQL Library</a> and <a class="xref" href="howto-configure-service.html" title="Configure a Service">Configure a Service</a>.</p></div><div class="section" title="PostgreSQL"><div class="titlepage"><div><div><h4 class="title"><a id="_postgresql"></a>PostgreSQL</h4></div></div></div><p>Maximum number of entities is unlimited.</p><p>Assembly is done using the provided Assembler:</p><pre class="programlisting brush: java">public void assemble( ModuleAssembly module ) + throws AssemblyException +{ + [...snip...] + + // DataSourceService + new DBCPDataSourceServiceAssembler(). + identifiedBy( "postgresql-datasource-service" ). + visibleIn( Visibility.module ). + withConfig( config, Visibility.layer ). + assemble( module ); + + // DataSource + new DataSourceAssembler(). + withDataSourceServiceIdentity( "postgresql-datasource-service" ). + identifiedBy( "postgresql-datasource" ). + visibleIn( Visibility.module ). + withCircuitBreaker(). + assemble( module ); + + // SQL EntityStore + new PostgreSQLEntityStoreAssembler(). + visibleIn( Visibility.application ). + withConfig( config, Visibility.layer ). + assemble( module ); +} +</pre><p>Sample DataSource configuration defaults:</p><pre class="programlisting brush: java"># +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# + +enabled=true +url=jdbc:postgresql://localhost:5432/jdbc_test_db +driver=org.postgresql.Driver +username=jdbc_test_login +password=password</pre></div><div class="section" title="MySQL and MariaDB"><div class="titlepage"><div><div><h4 class="title"><a id="_mysql_and_mariadb"></a>MySQL and MariaDB</h4></div></div></div><p>Maximum number of entities depends on the choosen storage engine.</p><p>Assembly is done using the provided Assembler:</p><pre class="programlisting brush: java">public void assemble( ModuleAssembly module ) + throws AssemblyException +{ + [...snip...] + + // DataSourceService + new DBCPDataSourceServiceAssembler(). + identifiedBy( "mysql-datasource-service" ). + visibleIn( Visibility.module ). + withConfig( config, Visibility.layer ). + assemble( module ); + + // DataSource + new DataSourceAssembler(). + withDataSourceServiceIdentity( "mysql-datasource-service" ). + identifiedBy( "mysql-datasource" ). + visibleIn( Visibility.module ). + withCircuitBreaker(). + assemble( module ); + + // SQL EntityStore + new MySQLEntityStoreAssembler(). + visibleIn( Visibility.application ). + withConfig( config, Visibility.layer ). + assemble( module ); +} +</pre><p>Sample DataSource configuration defaults:</p><pre class="programlisting brush: java"># +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# + +enabled=true +url=jdbc:mysql://localhost:3306/jdbc_test_db?profileSQL=true&useLegacyDatetimeCode=false&serverTimezone=UTC +driver=com.mysql.jdbc.Driver +username=root +password=</pre></div><div class="section" title="SQLite"><div class="titlepage"><div><div><h4 class="title"><a id="_sqlite"></a>SQLite</h4></div></div></div><p>Maximum number of entities is unlimited.</p><p>The <a class="ulink" href="http://www.xerial.org/trac/Xerial/wiki/SQLiteJDBC" target="_top">Xerial SQLite JDBC</a> driver is recommended. +It provides native support on Linux, Windows and MaxOSX, pure Java on other OSes.</p><p>Assembly is done using the provided Assembler:</p><pre class="programlisting brush: java">public void assemble( ModuleAssembly module ) + throws AssemblyException +{ + [...snip...] + + // DataSourceService + new DBCPDataSourceServiceAssembler(). + identifiedBy( "sqlite-datasource-service" ). + visibleIn( Visibility.module ). + withConfig( config, Visibility.layer ). + assemble( module ); + + // DataSource + new DataSourceAssembler(). + withDataSourceServiceIdentity( "sqlite-datasource-service" ). + identifiedBy( "sqlite-datasource" ). + visibleIn( Visibility.module ). + withCircuitBreaker(). + assemble( module ); + + // SQL EntityStore + new SQLiteEntityStoreAssembler(). + visibleIn( Visibility.application ). + withConfig( config, Visibility.layer ). + assemble( module ); +} +</pre><p>Sample DataSource configuration defaults:</p><pre class="programlisting brush: java"># +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# + +enabled=true +url=jdbc:sqlite::memory: +driver=org.sqlite.JDBC +username= +password=</pre></div><div class="section" title="H2 Database Engine"><div class="titlepage"><div><div><h4 class="title"><a id="_h2_database_engine"></a>H2 Database Engine</h4></div></div></div><p>Maximum number of entities is 2^64.</p><p>Assembly is done using the provided Assembler:</p><pre class="programlisting brush: java">public void assemble( ModuleAssembly module ) + throws AssemblyException +{ + [...snip...] + + // DataSourceService + new DBCPDataSourceServiceAssembler(). + identifiedBy( "h2-datasource-service" ). + visibleIn( Visibility.module ). + withConfig( config, Visibility.layer ). + assemble( module ); + + // DataSource + new DataSourceAssembler(). + withDataSourceServiceIdentity( "h2-datasource-service" ). + identifiedBy( "h2-datasource" ). + visibleIn( Visibility.module ). + withCircuitBreaker(). + assemble( module ); + + // SQL EntityStore + new H2SQLEntityStoreAssembler(). + visibleIn( Visibility.application ). + withConfig( config, Visibility.layer ). + assemble( module ); +} +</pre><p>Sample DataSource configuration defaults:</p><pre class="programlisting brush: java"># +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# + +enabled=true +url=jdbc:h2:mem:test +driver=org.h2.Driver +username= +password=</pre></div><div class="section" title="Apache Derby and Oracle JavaDB"><div class="titlepage"><div><div><h4 class="title"><a id="_apache_derby_and_oracle_javadb"></a>Apache Derby and Oracle JavaDB</h4></div></div></div><p>Maximum number of entities is unlimited.</p><p>Assembly is done using the provided Assembler:</p><pre class="programlisting brush: java">public void assemble( ModuleAssembly module ) + throws AssemblyException +{ + [...snip...] + + // DataSourceService + new DBCPDataSourceServiceAssembler(). + identifiedBy( "derby-datasource-service" ). + visibleIn( Visibility.module ). + withConfig( config, Visibility.layer ). + assemble( module ); + + // DataSource + new DataSourceAssembler(). + withDataSourceServiceIdentity( "derby-datasource-service" ). + identifiedBy( "derby-datasource" ). + visibleIn( Visibility.module ). + withCircuitBreaker(). + assemble( module ); + + // SQL EntityStore + new DerbySQLEntityStoreAssembler(). + visibleIn( Visibility.application ). + withConfig( config, Visibility.layer ). + assemble( module ); +} +</pre><p>Sample DataSource configuration defaults:</p><pre class="programlisting brush: java"># +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# + +enabled=true +url=jdbc:derby:memory:testdb;create=true +driver=org.apache.derby.jdbc.EmbeddedDriver +username= +password=</pre></div></div><div xmlns="" xmlns:exsl="http://exslt.org/common" class="footer"><p> + Copyright © 2015 The Apache Software Foundation, Licensed under the <a href="http://www.apache.org/licenses/" target="_blank">Apache License, Version 2.0</a>. + <br /><small> + Apache Polygene, Polygene, Apache, the Apache feather logo, and the Apache Polygene project logo are trademarks of The Apache Software Foundation.<br /> + All other marks mentioned may be trademarks or registered trademarks of their respective owners. + </small></p></div></body></html> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/polygene-website/blob/ba3a0fac/content/java/develop/extension-index-elasticsearch.html ---------------------------------------------------------------------- diff --git a/content/java/develop/extension-index-elasticsearch.html b/content/java/develop/extension-index-elasticsearch.html new file mode 100644 index 0000000..3b20faa --- /dev/null +++ b/content/java/develop/extension-index-elasticsearch.html @@ -0,0 +1,167 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>ElasticSearch Index/Query</title><link rel="stylesheet" type="text/css" href="css/style.css" /><meta name="generator" content="DocBook XSL Stylesheets V1.76.1" /><link rel="home" href="index.html" title="" /><link rel="up" href="extensions.html" title="Extensions" /><link rel="prev" href="extension-es-sql.html" title="SQL EntityStore" /><link rel="next" href="extension-index-rdf.html" title="OpenRDF Index/Query" /> + + +<!-- favicon --> + +<link rel="shortcut icon" href="http://polygene.apache.org/favicon.ico" type="image/vnd.microsoft.icon" /> +<link rel="icon" href="http://polygene.apache.org/favicon.ico" type="image/x-icon" /> + +<!-- style --> + +<link href="css/shCore.css" rel="stylesheet" type="text/css" /> +<link href="css/shCoreEclipse.css" rel="stylesheet" type="text/css" /> +<link href="css/shThemeEclipse.css" rel="stylesheet" type="text/css" /> +<link href="css/polygene.css" rel="stylesheet" type="text/css" /> + +<!-- Syntax Highlighter --> + +<script type="text/javascript" src="js/shCore.js"></script> +<script type="text/javascript" src="js/shBrushJava.js"></script> +<script type="text/javascript" src="js/shBrushScala.js"></script> +<script type="text/javascript" src="js/shBrushJScript.js"></script> +<script type="text/javascript" src="js/shBrushBash.js"></script> +<script type="text/javascript" src="js/shBrushPlain.js"></script> +<script type="text/javascript" src="js/shBrushXml.js"></script> +<script type="text/javascript" src="js/shBrushGroovy.js"></script> +<script type="text/javascript" src="js/shBrushPython.js"></script> +<script type="text/javascript" src="js/shBrushRuby.js"></script> +<script type="text/javascript" src="js/shBrushCSharp.js"></script> + +<script type="text/javascript"> + SyntaxHighlighter.defaults['tab-size'] = 4; + SyntaxHighlighter.defaults['gutter'] = false; + SyntaxHighlighter.defaults['toolbar'] = false; + SyntaxHighlighter.all() +</script> + +<!-- JQuery --> + +<script type="text/javascript" src="js/jquery-1.6.4.min.js"></script> + +<!-- Image Scaler --> + +<script type="text/javascript" src="js/imagescaler.js"></script> + +<!-- Table Styler --> + +<script type="text/javascript" src="js/tablestyler.js"></script> + +<!-- Apache Polygene WebSite Progressive Enhancement --> + +<link href="css/progressive-enhancement.css" rel="stylesheet" type="text/css" /> +<script type="text/javascript" src="js/jquery.scrollTo-1.4.2.js"></script> +<script type="text/javascript" src="js/progressive-enhancement.js"></script> + +<!-- Analytics --> + <script type="text/javascript"> + var _gaq = _gaq || []; + _gaq.push(['_setAccount', 'UA-62007352-1']); + _gaq.push(['_trackPageview']); + + (function() { + var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; + ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; + var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); + })(); + </script> + + </head><body><div xmlns="" xmlns:exsl="http://exslt.org/common" class="logo"><a href="index.html"><img src="images/logo-standard.png" /></a></div><div xmlns="" xmlns:exsl="http://exslt.org/common" class="top-nav"><div xmlns="http://www.w3.org/1999/xhtml" class="toc"><dl><dt><span class="section"><a href="index.html#home">Polygeneâ¢</a></span></dt><dt><span class="section"><a href="intro.html">Introduction</a></span></dt><dt><span class="section"><a href="tutorials.html">Tutorials</a></span></dt><dt><span class="section"><a href="javadocs.html">Javadoc</a></span></dt><dt><span class="section"><a href="samples.html">Samples</a></span></dt><dt><span class="section"><a href="core.html">Core</a></span></dt><dt><span class="section"><a href="libraries.html">Libraries</a></span></dt><dt><span class="section"><span xmlns="" href="extensions.html">Extensions</span></span></dt><dt><span class="section"><a href="tools.html">Tools</a></span></dt><dt><span class="section"><a href="glossary.ht ml">Glossary </a></span></dt></dl></div></div><div xmlns="" xmlns:exsl="http://exslt.org/common" class="sub-nav"><div xmlns="http://www.w3.org/1999/xhtml" class="toc"><dl><dt><span class="section"><a href="extensions.html#_overview_7">Overview</a></span></dt><dt><span class="section"><a href="extension-vs-orgjson.html">org.json ValueSerialization</a></span></dt><dt><span class="section"><a href="extension-vs-jackson.html">Jackson ValueSerialization</a></span></dt><dt><span class="section"><a href="extension-vs-stax.html">StAX ValueSerialization</a></span></dt><dt><span class="section"><a href="extension-cache-ehcache.html">Ehcache Cache</a></span></dt><dt><span class="section"><a href="extension-cache-memcache.html">Memcache Cache</a></span></dt><dt><span class="section"><a href="extension-es-memory.html">Memory EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-file.html">File EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-geode. html">Geode EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-hazelcast.html">Hazelcast EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-jclouds.html">JClouds EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-jdbm.html">JDBM EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-leveldb.html">LevelDB EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-mongodb.html">MongoDB EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-preferences.html">Preferences EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-redis.html">Redis EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-riak.html">Riak EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-sql.html">SQL EntityStore</a></span></dt><dt><span class="section"><span xmlns="" href="extension-index-elasticsearch.html">ElasticSearch Index/Query</span></span></dt><dt><span class="section"><a href="extension-index-rdf.html">OpenRDF Index/Query</a></span></dt><dt><span class="section"><a href="extension-index-solr.html">Apache Solr Index/Query</a></span></dt><dt><span class="section"><a href="extension-indexing-sql.html">SQL Index/Query</a></span></dt><dt><span class="section"><a href="extension-metrics-metrics.html">Codahale Metrics</a></span></dt><dt><span class="section"><a href="extension-migration.html">Migration</a></span></dt><dt><span class="section"><a href="extension-reindexer.html">Reindexer</a></span></dt></dl></div></div><div class="section" title="ElasticSearch Index/Query"><div class="titlepage"><div><div><h3 class="title"><a id="extension-index-elasticsearch"></a>ElasticSearch Index/Query</h3></div></div></div><p class="remark"><em><span class="comment"></span></em></p><p class="devstatus-code-beta">code</p><p class="devstatus-docs-good">docs</p><p class="devstatus-tests-good">tests</p><p>Index/Que ry services backed by <a class="ulink" href="http://www.elasticsearch.org/" target="_top">ElasticSearch</a> search engine built on top of +<a class="ulink" href="http://lucene.apache.org/" target="_top">Apache Lucene</a>.</p><div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>ElasticSearch Index/Query do not support ComplexQueries from the Query API, ie. queries by "example value".</p></div><p>Three modes of operation are supported:</p><div class="itemizedlist"><ul class="itemizedlist"><li class="listitem"> +embedded local only filesystem based node ; +</li><li class="listitem"> +managed cluster client ; +</li><li class="listitem"> +with a provided client. +</li></ul></div><p>In any case, Lucene hard limits apply. +See the <a class="ulink" href="https://lucene.apache.org/core/6_1_0/core/org/apache/lucene/codecs/lucene60/package-summary.html#Limitations" target="_top">Lucene File Format</a> +documentation about maximum index size and document count. +Moreover, each field cannot be larger than 32766 bytes in its serialized form.</p><div class="section" title="Embedded on local file system"><div class="titlepage"><div><div><h4 class="title"><a id="_embedded_on_local_file_system"></a>Embedded on local file system</h4></div></div></div><p>Filesystem based ElasticSearch Index/Query service relies on the <a class="xref" href="library-fileconfig.html" title="FileConfig">FileConfig Library</a> to decide where it stores its +index data, transaction logs etcâ¦</p><p>Assembly is done using the provided Assembler:</p><pre class="programlisting brush: java">new ESFilesystemIndexQueryAssembler() + .withConfig( configModule, configVisibility ) + .assemble( module ); +</pre><div class="section" title="Configuration"><div class="titlepage"><div><div><h5 class="title"><a id="_configuration_15"></a>Configuration</h5></div></div></div><div class="important" title="Important" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Important</h3><p>By default queries can only traverse Aggregated Associations, if you want to be able to traverse all +Associations set the <code class="literal">indexNonAggregatedAssociations</code> configuration property to <code class="literal">TRUE</code>.</p></div><p>Here are the configuration properties for the filesystem ElasticSearch Index/Query services:</p><pre class="programlisting brush: java">public interface ElasticSearchConfiguration + extends ConfigurationComposite +{ + + /** + * Cluster name. + * Defaults to 'polygene_cluster'. + */ + @Optional Property<String> clusterName(); + + /** + * Index name. + * Defaults to 'polygene_index'. + */ + @Optional Property<String> index(); + + /** + * Set to true to index non aggregated associations as if they were aggregated. + * WARN: Don't use this if your domain model contains circular dependencies. + * Defaults to 'FALSE'. + */ + @UseDefaults Property<Boolean> indexNonAggregatedAssociations(); + +} +</pre><p>All configuration properties are defaulted meaning that you can use ElasticSearch Index/Query service without +configuration.</p></div></div><div class="section" title="In an ElasticSearch cluster"><div class="titlepage"><div><div><h4 class="title"><a id="_in_an_elasticsearch_cluster"></a>In an ElasticSearch cluster</h4></div></div></div><div class="section" title="Assembly"><div class="titlepage"><div><div><h5 class="title"><a id="_assembly_21"></a>Assembly</h5></div></div></div><p>Assembly is done using the provided Assembler:</p><pre class="programlisting brush: java">new ESClusterIndexQueryAssembler() + .withConfig( configModule, configVisibility ) + .assemble( module ); +</pre></div><div class="section" title="Configuration"><div class="titlepage"><div><div><h5 class="title"><a id="_configuration_16"></a>Configuration</h5></div></div></div><p>Here are the configuration properties for the clustered ElasticSearch Index/Query service. Note that it inherits the +properties defined in the filesystem configuration, see above.</p><pre class="programlisting brush: java">public interface ElasticSearchClusterConfiguration + extends ElasticSearchConfiguration +{ + + /** + * Coma separated list of nodes host:port. + * Defaults to '127.0.0.1:9300'. + */ + @Optional Property<String> nodes(); + + /** + * Allows client to sniff the rest of the cluster, and add those into its list of machines to use. + * In this case, note that the ip addresses used will be the ones that the other nodes were started + * with (the âpublishâ address). + * Defaults to FALSE. + */ + @UseDefaults Property<Boolean> clusterSniff(); + + /** + * Set to true to ignore cluster name validation of connected nodes. + * Defaults to FALSE. + */ + @UseDefaults Property<Boolean> ignoreClusterName(); + + /** + * The time to wait for a ping response from a node. + * Defaults to 5s. + */ + @Optional Property<String> pingTimeout(); + + /** + * How often to sample / ping the nodes listed and connected. + * Defaults to 5s. + */ + @Optional Property<String> samplerInterval(); + +} +</pre><p>Again, all configuration properties are defaulted meaning that you can use ElasticSearch Index/Query service without +configuration.</p></div></div><div class="section" title="Using a provided client"><div class="titlepage"><div><div><h4 class="title"><a id="_using_a_provided_client"></a>Using a provided client</h4></div></div></div><div class="section" title="Assembly"><div class="titlepage"><div><div><h5 class="title"><a id="_assembly_22"></a>Assembly</h5></div></div></div><p>Assembly is done using the provided Assembler:</p><pre class="programlisting brush: java">new ESClientIndexQueryAssembler( client ) + .withConfig( configModule, configVisibility ) + .assemble( module ); +</pre></div><div class="section" title="Configuration"><div class="titlepage"><div><div><h5 class="title"><a id="_configuration_17"></a>Configuration</h5></div></div></div><p>Here are the configuration properties for the ElasticSearch Index/Query service using a provided client. +Note that the <code class="literal">clusterName</code> is ignored as this is managed by the client.</p><pre class="programlisting brush: java">Traceback (most recent call last): + File "/Users/paul/.asciidoc/filters/snippet/snippet.py", line 100, in <module> + for line in snippet(**configuration(indata)): + File "/Users/paul/.asciidoc/filters/snippet/snippet.py", line 83, in snippet + raise ValueError('Missing snippet for tag "' + tag + '" in file "' + source + '".') +ValueError: Missing snippet for tag "client" in file "extensions/indexing-elasticsearch/src/main/java/org/apache/polygene/index/elasticsearch/ElasticSearchConfiguration.java". +</pre><p>Again, all configuration properties are defaulted meaning that you can use ElasticSearch Index/Query service without +configuration.</p></div></div></div><div xmlns="" xmlns:exsl="http://exslt.org/common" class="footer"><p> + Copyright © 2015 The Apache Software Foundation, Licensed under the <a href="http://www.apache.org/licenses/" target="_blank">Apache License, Version 2.0</a>. + <br /><small> + Apache Polygene, Polygene, Apache, the Apache feather logo, and the Apache Polygene project logo are trademarks of The Apache Software Foundation.<br /> + All other marks mentioned may be trademarks or registered trademarks of their respective owners. + </small></p></div></body></html> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/polygene-website/blob/ba3a0fac/content/java/develop/extension-index-rdf.html ---------------------------------------------------------------------- diff --git a/content/java/develop/extension-index-rdf.html b/content/java/develop/extension-index-rdf.html new file mode 100644 index 0000000..8afa2a5 --- /dev/null +++ b/content/java/develop/extension-index-rdf.html @@ -0,0 +1,259 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>OpenRDF Index/Query</title><link rel="stylesheet" type="text/css" href="css/style.css" /><meta name="generator" content="DocBook XSL Stylesheets V1.76.1" /><link rel="home" href="index.html" title="" /><link rel="up" href="extensions.html" title="Extensions" /><link rel="prev" href="extension-index-elasticsearch.html" title="ElasticSearch Index/Query" /><link rel="next" href="extension-index-solr.html" title="Apache Solr Index/Query" /> + + +<!-- favicon --> + +<link rel="shortcut icon" href="http://polygene.apache.org/favicon.ico" type="image/vnd.microsoft.icon" /> +<link rel="icon" href="http://polygene.apache.org/favicon.ico" type="image/x-icon" /> + +<!-- style --> + +<link href="css/shCore.css" rel="stylesheet" type="text/css" /> +<link href="css/shCoreEclipse.css" rel="stylesheet" type="text/css" /> +<link href="css/shThemeEclipse.css" rel="stylesheet" type="text/css" /> +<link href="css/polygene.css" rel="stylesheet" type="text/css" /> + +<!-- Syntax Highlighter --> + +<script type="text/javascript" src="js/shCore.js"></script> +<script type="text/javascript" src="js/shBrushJava.js"></script> +<script type="text/javascript" src="js/shBrushScala.js"></script> +<script type="text/javascript" src="js/shBrushJScript.js"></script> +<script type="text/javascript" src="js/shBrushBash.js"></script> +<script type="text/javascript" src="js/shBrushPlain.js"></script> +<script type="text/javascript" src="js/shBrushXml.js"></script> +<script type="text/javascript" src="js/shBrushGroovy.js"></script> +<script type="text/javascript" src="js/shBrushPython.js"></script> +<script type="text/javascript" src="js/shBrushRuby.js"></script> +<script type="text/javascript" src="js/shBrushCSharp.js"></script> + +<script type="text/javascript"> + SyntaxHighlighter.defaults['tab-size'] = 4; + SyntaxHighlighter.defaults['gutter'] = false; + SyntaxHighlighter.defaults['toolbar'] = false; + SyntaxHighlighter.all() +</script> + +<!-- JQuery --> + +<script type="text/javascript" src="js/jquery-1.6.4.min.js"></script> + +<!-- Image Scaler --> + +<script type="text/javascript" src="js/imagescaler.js"></script> + +<!-- Table Styler --> + +<script type="text/javascript" src="js/tablestyler.js"></script> + +<!-- Apache Polygene WebSite Progressive Enhancement --> + +<link href="css/progressive-enhancement.css" rel="stylesheet" type="text/css" /> +<script type="text/javascript" src="js/jquery.scrollTo-1.4.2.js"></script> +<script type="text/javascript" src="js/progressive-enhancement.js"></script> + +<!-- Analytics --> + <script type="text/javascript"> + var _gaq = _gaq || []; + _gaq.push(['_setAccount', 'UA-62007352-1']); + _gaq.push(['_trackPageview']); + + (function() { + var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; + ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; + var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); + })(); + </script> + + </head><body><div xmlns="" xmlns:exsl="http://exslt.org/common" class="logo"><a href="index.html"><img src="images/logo-standard.png" /></a></div><div xmlns="" xmlns:exsl="http://exslt.org/common" class="top-nav"><div xmlns="http://www.w3.org/1999/xhtml" class="toc"><dl><dt><span class="section"><a href="index.html#home">Polygeneâ¢</a></span></dt><dt><span class="section"><a href="intro.html">Introduction</a></span></dt><dt><span class="section"><a href="tutorials.html">Tutorials</a></span></dt><dt><span class="section"><a href="javadocs.html">Javadoc</a></span></dt><dt><span class="section"><a href="samples.html">Samples</a></span></dt><dt><span class="section"><a href="core.html">Core</a></span></dt><dt><span class="section"><a href="libraries.html">Libraries</a></span></dt><dt><span class="section"><span xmlns="" href="extensions.html">Extensions</span></span></dt><dt><span class="section"><a href="tools.html">Tools</a></span></dt><dt><span class="section"><a href="glossary.ht ml">Glossary </a></span></dt></dl></div></div><div xmlns="" xmlns:exsl="http://exslt.org/common" class="sub-nav"><div xmlns="http://www.w3.org/1999/xhtml" class="toc"><dl><dt><span class="section"><a href="extensions.html#_overview_7">Overview</a></span></dt><dt><span class="section"><a href="extension-vs-orgjson.html">org.json ValueSerialization</a></span></dt><dt><span class="section"><a href="extension-vs-jackson.html">Jackson ValueSerialization</a></span></dt><dt><span class="section"><a href="extension-vs-stax.html">StAX ValueSerialization</a></span></dt><dt><span class="section"><a href="extension-cache-ehcache.html">Ehcache Cache</a></span></dt><dt><span class="section"><a href="extension-cache-memcache.html">Memcache Cache</a></span></dt><dt><span class="section"><a href="extension-es-memory.html">Memory EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-file.html">File EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-geode. html">Geode EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-hazelcast.html">Hazelcast EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-jclouds.html">JClouds EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-jdbm.html">JDBM EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-leveldb.html">LevelDB EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-mongodb.html">MongoDB EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-preferences.html">Preferences EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-redis.html">Redis EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-riak.html">Riak EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-sql.html">SQL EntityStore</a></span></dt><dt><span class="section"><a href="extension-index-elasticsearch.html">ElasticSearch Index/Query< /a></span></dt><dt><span class="section"><span xmlns="" href="extension-index-rdf.html">OpenRDF Index/Query</span></span></dt><dt><span class="section"><a href="extension-index-solr.html">Apache Solr Index/Query</a></span></dt><dt><span class="section"><a href="extension-indexing-sql.html">SQL Index/Query</a></span></dt><dt><span class="section"><a href="extension-metrics-metrics.html">Codahale Metrics</a></span></dt><dt><span class="section"><a href="extension-migration.html">Migration</a></span></dt><dt><span class="section"><a href="extension-reindexer.html">Reindexer</a></span></dt></dl></div></div><div class="section" title="OpenRDF Index/Query"><div class="titlepage"><div><div><h3 class="title"><a id="extension-index-rdf"></a>OpenRDF Index/Query</h3></div></div></div><p class="remark"><em><span class="comment"></span></em></p><p class="devstatus-code-stable">code</p><p class="devstatus-docs-brief">docs</p><p class="devstatus-tests-good">tests</p><p>Index/Query services backed by <a class="ulink" href="http://www.openrdf.org/" target="_top">OpenRDF Sesame</a> framework for processing RDF data.</p><div class="section" title="In Memory"><div class="titlepage"><div><div><h4 class="title"><a id="_in_memory"></a>In Memory</h4></div></div></div><p>Assembly is done using the provided Assembler:</p><pre class="programlisting brush: java">new RdfMemoryStoreAssembler().assemble( module ); +</pre><p>No configuration needed.</p></div><div class="section" title="On Filesystem"><div class="titlepage"><div><div><h4 class="title"><a id="_on_filesystem"></a>On Filesystem</h4></div></div></div><div class="section" title="Assembly"><div class="titlepage"><div><div><h5 class="title"><a id="_assembly_23"></a>Assembly</h5></div></div></div><p>Assembly is done using the provided Assembler:</p><pre class="programlisting brush: java">new RdfNativeSesameStoreAssembler().assemble( module ); +</pre></div><div class="section" title="Configuration"><div class="titlepage"><div><div><h5 class="title"><a id="_configuration_18"></a>Configuration</h5></div></div></div><p>Here are the configuration properties for the Native RDF Index/Query:</p><pre class="programlisting brush: java">public interface NativeConfiguration extends ConfigurationComposite +{ + @Optional @Matches( "([spoc][spoc][spoc][spoc],?)*" ) Property<String> tripleIndexes(); + + @Optional Property<String> dataDirectory(); + + @UseDefaults Property<Boolean> forceSync(); +} +</pre></div></div><div class="section" title="In a RDBMS"><div class="titlepage"><div><div><h4 class="title"><a id="_in_a_rdbms"></a>In a RDBMS</h4></div></div></div><div class="section" title="Assembly"><div class="titlepage"><div><div><h5 class="title"><a id="_assembly_24"></a>Assembly</h5></div></div></div><p>Assembly is done using the provided Assembler:</p><pre class="programlisting brush: java">new RdfRdbmsSesameStoreAssembler().assemble( module ); +</pre></div><div class="section" title="Configuration"><div class="titlepage"><div><div><h5 class="title"><a id="_configuration_19"></a>Configuration</h5></div></div></div><p>Here are the configuration properties for the RDBMS based RDF Index/Query:</p><pre class="programlisting brush: java">public interface RdbmsRepositoryConfiguration +{ + Property<String> jdbcDriver(); + Property<String> jdbcUrl(); + Property<String> user(); + Property<String> password(); +} +</pre></div></div><div class="section" title="Named RDF Queries"><div class="titlepage"><div><div><h4 class="title"><a id="_named_rdf_queries"></a>Named RDF Queries</h4></div></div></div><p>RDF queries are rather difficult to create manually. Not only do you need to learn a difficult language and a new +syntax, but also need to understand the indexing model that happens in Apache Polygene RDF indexing system.</p><p>Below follows a large set of working queries, which can be used as a starting point. See the testcases for +details of the Entity model that is being indexed.</p><pre class="programlisting brush: java">"PREFIX ns0: <urn:polygene:type:org.apache.polygene.api.identity.HasIdentity#> \n" + + "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> \n" + + "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> \n" + "SELECT DISTINCT ?reference\n" + + "WHERE {\n" + "?entityType rdfs:subClassOf <urn:polygene:type:org.apache.polygene.test.indexing.model.Person>. \n" + + "?entity rdf:type ?entityType. \n" + "?entity ns0:identity ?reference. \n" + "\n" + "}", // script01 +</pre><pre class="programlisting brush: java">"PREFIX ns1: <urn:polygene:type:org.apache.polygene.test.indexing.model.Nameable#> \n" + + "PREFIX ns0: <urn:polygene:type:org.apache.polygene.api.identity.HasIdentity#> \n" + + "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> \n" + + "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> \n" + "SELECT DISTINCT ?reference\n" + + "WHERE {\n" + "?entityType rdfs:subClassOf <urn:polygene:type:org.apache.polygene.test.indexing.model.Domain>. \n" + + "?entity rdf:type ?entityType. \n" + "?entity ns0:identity ?reference. \n" + "?entity ns1:name ?v0. \n" + + "FILTER (?v0 = \"Gaming\")\n" + "}", // script02 +</pre><pre class="programlisting brush: java">"PREFIX ns0: <urn:polygene:type:org.apache.polygene.api.identity.HasIdentity#> \n" + + "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> \n" + + "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> \n" + "SELECT DISTINCT ?reference\n" + + "WHERE {\n" + "?entityType rdfs:subClassOf <urn:polygene:type:org.apache.polygene.test.indexing.model.Nameable>. \n" + + "?entity rdf:type ?entityType. \n" + "?entity ns0:identity ?reference. \n" + "\n" + "}", // script03 +</pre><pre class="programlisting brush: java">"PREFIX ns1: <urn:polygene:type:org.apache.polygene.test.indexing.model.Person#> \n" + + "PREFIX ns2: <urn:polygene:type:org.apache.polygene.test.indexing.model.Nameable#> \n" + + "PREFIX ns0: <urn:polygene:type:org.apache.polygene.api.identity.HasIdentity#> \n" + + "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> \n" + + "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> \n" + "SELECT DISTINCT ?reference\n" + + "WHERE {\n" + "?entityType rdfs:subClassOf <urn:polygene:type:org.apache.polygene.test.indexing.model.Person>. \n" + + "?entity rdf:type ?entityType. \n" + "?entity ns0:identity ?reference. \n" + + "?entity ns1:placeOfBirth ?v0. \n" + "?v0 ns2:name ?v1. \n" + "FILTER (?v1 = \"Kuala Lumpur\")\n" + "}", // script04 +</pre><pre class="programlisting brush: java">"PREFIX ns1: <urn:polygene:type:org.apache.polygene.test.indexing.model.Person#> \n" + + "PREFIX ns2: <urn:polygene:type:org.apache.polygene.test.indexing.model.Nameable#> \n" + + "PREFIX ns0: <urn:polygene:type:org.apache.polygene.api.identity.HasIdentity#> \n" + + "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> \n" + + "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> \n" + "SELECT DISTINCT ?reference\n" + + "WHERE {\n" + "?entityType rdfs:subClassOf <urn:polygene:type:org.apache.polygene.test.indexing.model.Person>. \n" + + "?entity rdf:type ?entityType. \n" + "?entity ns0:identity ?reference. \n" + "?entity ns1:mother ?v0. \n" + + "?v0 ns1:placeOfBirth ?v1. \n" + "?v1 ns2:name ?v2. \n" + "FILTER (?v2 = \"Kuala Lumpur\")\n" + "}", // script05 +</pre><pre class="programlisting brush: java">"PREFIX ns1: <urn:polygene:type:org.apache.polygene.test.indexing.model.Person#> \n" + + "PREFIX ns0: <urn:polygene:type:org.apache.polygene.api.identity.HasIdentity#> \n" + + "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> \n" + + "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> \n" + "SELECT DISTINCT ?reference\n" + + "WHERE {\n" + "?entityType rdfs:subClassOf <urn:polygene:type:org.apache.polygene.test.indexing.model.Person>. \n" + + "?entity rdf:type ?entityType. \n" + "?entity ns0:identity ?reference. \n" + + "?entity ns1:yearOfBirth ?v0. \n" + "FILTER (?v0 >= \"1973\")\n" + "}", // script06 +</pre><pre class="programlisting brush: java">"PREFIX ns1: <urn:polygene:type:org.apache.polygene.test.indexing.model.Person#> \n" + + "PREFIX ns2: <urn:polygene:type:org.apache.polygene.test.indexing.model.Nameable#> \n" + + "PREFIX ns0: <urn:polygene:type:org.apache.polygene.api.identity.HasIdentity#> \n" + + "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> \n" + + "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> \n" + "SELECT DISTINCT ?reference\n" + + "WHERE {\n" + "?entityType rdfs:subClassOf <urn:polygene:type:org.apache.polygene.test.indexing.model.Nameable>. \n" + + "?entity rdf:type ?entityType. \n" + "?entity ns0:identity ?reference. \n" + + "?entity ns1:yearOfBirth ?v0. \n" + "?entity ns1:placeOfBirth ?v1. \n" + "?v1 ns2:name ?v2. \n" + + "FILTER ((?v0 >= \"1900\") && (?v2 = \"Penang\"))\n" + "}", // script07 +</pre><pre class="programlisting brush: java">"PREFIX ns1: <urn:polygene:type:org.apache.polygene.test.indexing.model.Person#> \n" + + "PREFIX ns0: <urn:polygene:type:org.apache.polygene.api.identity.HasIdentity#> \n" + + "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> \n" + + "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> \n" + "SELECT DISTINCT ?reference\n" + + "WHERE {\n" + "?entityType rdfs:subClassOf <urn:polygene:type:org.apache.polygene.test.indexing.model.Person>. \n" + + "?entity rdf:type ?entityType. \n" + "?entity ns0:identity ?reference. \n" + + "?entity ns1:yearOfBirth ?v0. \n" + "FILTER ((?v0 = \"1970\") || (?v0 = \"1975\"))\n" + "}", // script08 +</pre><pre class="programlisting brush: java">"PREFIX ns1: <urn:polygene:type:org.apache.polygene.test.indexing.model.Person#> \n" + + "PREFIX ns0: <urn:polygene:type:org.apache.polygene.api.identity.HasIdentity#> \n" + + "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> \n" + + "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> \n" + "SELECT DISTINCT ?reference\n" + + "WHERE {\n" + "?entityType rdfs:subClassOf <urn:polygene:type:org.apache.polygene.test.indexing.model.Female>. \n" + + "?entity rdf:type ?entityType. \n" + "?entity ns0:identity ?reference. \n" + + "?entity ns1:yearOfBirth ?v0. \n" + "FILTER ((?v0 = \"1970\") || (?v0 = \"1975\"))\n" + "}", // script09 +</pre><pre class="programlisting brush: java">"PREFIX ns1: <urn:polygene:type:org.apache.polygene.test.indexing.model.Person#> \n" + + "PREFIX ns0: <urn:polygene:type:org.apache.polygene.api.identity.HasIdentity#> \n" + + "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> \n" + + "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> \n" + "SELECT DISTINCT ?reference\n" + + "WHERE {\n" + "?entityType rdfs:subClassOf <urn:polygene:type:org.apache.polygene.test.indexing.model.Person>. \n" + + "?entity rdf:type ?entityType. \n" + "?entity ns0:identity ?reference. \n" + + "?entity ns1:yearOfBirth ?v0. \n" + "FILTER (!(?v0 = \"1975\"))\n" + "}", // script10 +</pre><pre class="programlisting brush: java">"PREFIX ns1: <urn:polygene:type:org.apache.polygene.test.indexing.model.Person#> \n" + + "PREFIX ns0: <urn:polygene:type:org.apache.polygene.api.identity.HasIdentity#> \n" + + "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> \n" + + "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> \n" + "SELECT DISTINCT ?reference\n" + + "WHERE {\n" + "?entityType rdfs:subClassOf <urn:polygene:type:org.apache.polygene.test.indexing.model.Person>. \n" + + "?entity rdf:type ?entityType. \n" + "?entity ns0:identity ?reference. \n" + + "OPTIONAL {?entity ns1:email ?v0}. \n" + "FILTER (bound(?v0))\n" + "}", // script11 +</pre><pre class="programlisting brush: java">"PREFIX ns1: <urn:polygene:type:org.apache.polygene.test.indexing.model.Person#> \n" + + "PREFIX ns0: <urn:polygene:type:org.apache.polygene.api.identity.HasIdentity#> \n" + + "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> \n" + + "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> \n" + "SELECT DISTINCT ?reference\n" + + "WHERE {\n" + "?entityType rdfs:subClassOf <urn:polygene:type:org.apache.polygene.test.indexing.model.Person>. \n" + + "?entity rdf:type ?entityType. \n" + "?entity ns0:identity ?reference. \n" + + "OPTIONAL {?entity ns1:email ?v0}. \n" + "FILTER (! bound(?v0))\n" + "}", // script12 +</pre><pre class="programlisting brush: java">"PREFIX ns0: <urn:polygene:type:org.apache.polygene.api.identity.HasIdentity#> \n" + + "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> \n" + + "PREFIX ns1: <urn:polygene:type:org.apache.polygene.test.indexing.model.Male#> \n" + + "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> \n" + "SELECT DISTINCT ?reference\n" + + "WHERE {\n" + "?entityType rdfs:subClassOf <urn:polygene:type:org.apache.polygene.test.indexing.model.Person>. \n" + + "?entity rdf:type ?entityType. \n" + "?entity ns0:identity ?reference. \n" + + "OPTIONAL {?entity ns1:wife ?v0}. \n" + "FILTER (bound(?v0))\n" + "}", // script13 +</pre><pre class="programlisting brush: java">"PREFIX ns0: <urn:polygene:type:org.apache.polygene.api.identity.HasIdentity#> \n" + + "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> \n" + + "PREFIX ns1: <urn:polygene:type:org.apache.polygene.test.indexing.model.Male#> \n" + + "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> \n" + "SELECT DISTINCT ?reference\n" + + "WHERE {\n" + "?entityType rdfs:subClassOf <urn:polygene:type:org.apache.polygene.test.indexing.model.Male>. \n" + + "?entity rdf:type ?entityType. \n" + "?entity ns0:identity ?reference. \n" + + "OPTIONAL {?entity ns1:wife ?v0}. \n" + "FILTER (! bound(?v0))\n" + "}", // script14 +</pre><pre class="programlisting brush: java">"PREFIX ns0: <urn:polygene:type:org.apache.polygene.api.identity.HasIdentity#> \n" + + "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> \n" + + "PREFIX ns1: <urn:polygene:type:org.apache.polygene.test.indexing.model.Male#> \n" + + "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> \n" + "SELECT DISTINCT ?reference\n" + + "WHERE {\n" + "?entityType rdfs:subClassOf <urn:polygene:type:org.apache.polygene.test.indexing.model.Person>. \n" + + "?entity rdf:type ?entityType. \n" + "?entity ns0:identity ?reference. \n" + + "OPTIONAL {?entity ns1:wife ?v0}. \n" + "FILTER (! bound(?v0))\n" + "}", // script15 +</pre><pre class="programlisting brush: java">"PREFIX ns1: <urn:polygene:type:org.apache.polygene.test.indexing.model.Nameable#> \n" + + "PREFIX ns0: <urn:polygene:type:org.apache.polygene.api.identity.HasIdentity#> \n" + + "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> \n" + + "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> \n" + "SELECT DISTINCT ?reference\n" + + "WHERE {\n" + "?entityType rdfs:subClassOf <urn:polygene:type:org.apache.polygene.test.indexing.model.Nameable>. \n" + + "?entity rdf:type ?entityType. \n" + "?entity ns0:identity ?reference. \n" + "?entity ns1:name ?v0. \n" + + "\n" + "}", // script16 +</pre><pre class="programlisting brush: java">"PREFIX ns1: <urn:polygene:type:org.apache.polygene.test.indexing.model.Nameable#> \n" + + "PREFIX ns0: <urn:polygene:type:org.apache.polygene.api.identity.HasIdentity#> \n" + + "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> \n" + + "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> \n" + "SELECT DISTINCT ?reference\n" + + "WHERE {\n" + "?entityType rdfs:subClassOf <urn:polygene:type:org.apache.polygene.test.indexing.model.Nameable>. \n" + + "?entity rdf:type ?entityType. \n" + "?entity ns0:identity ?reference. \n" + "?entity ns1:name ?v0. \n" + + "\n" + "} ", // script17 +</pre><pre class="programlisting brush: java">"PREFIX ns1: <urn:polygene:type:org.apache.polygene.test.indexing.model.Nameable#> \n" + + "PREFIX ns0: <urn:polygene:type:org.apache.polygene.api.identity.HasIdentity#> \n" + + "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> \n" + + "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> \n" + "SELECT DISTINCT ?reference\n" + + "WHERE {\n" + "?entityType rdfs:subClassOf <urn:polygene:type:org.apache.polygene.test.indexing.model.Nameable>. \n" + + "?entity rdf:type ?entityType. \n" + "?entity ns0:identity ?reference. \n" + "?entity ns1:name ?v0. \n" + + "\n" + "}\n", // script18 +</pre><pre class="programlisting brush: java">"PREFIX ns1: <urn:polygene:type:org.apache.polygene.test.indexing.model.Nameable#> \n" + + "PREFIX ns0: <urn:polygene:type:org.apache.polygene.api.identity.HasIdentity#> \n" + + "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> \n" + + "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> \n" + "SELECT DISTINCT ?reference\n" + + "WHERE {\n" + "?entityType rdfs:subClassOf <urn:polygene:type:org.apache.polygene.test.indexing.model.Nameable>. \n" + + "?entity rdf:type ?entityType. \n" + "?entity ns0:identity ?reference. \n" + "?entity ns1:name ?v0. \n" + + "FILTER (?v0 > \"D\")\n" + "} ", // script19 +</pre><pre class="programlisting brush: java">"PREFIX ns1: <urn:polygene:type:org.apache.polygene.test.indexing.model.Person#> \n" + + "PREFIX ns2: <urn:polygene:type:org.apache.polygene.test.indexing.model.Nameable#> \n" + + "PREFIX ns0: <urn:polygene:type:org.apache.polygene.api.identity.HasIdentity#> \n" + + "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> \n" + + "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> \n" + "SELECT DISTINCT ?reference\n" + + "WHERE {\n" + "?entityType rdfs:subClassOf <urn:polygene:type:org.apache.polygene.test.indexing.model.Person>. \n" + + "?entity rdf:type ?entityType. \n" + "?entity ns0:identity ?reference. \n" + + "?entity ns1:yearOfBirth ?v0. \n" + "?entity ns2:name ?v1. \n" + "FILTER (?v0 > \"1973\")\n" + "}\n" + , // script20 +</pre><pre class="programlisting brush: java">"PREFIX ns1: <urn:polygene:type:org.apache.polygene.test.indexing.model.Person#> \n" + + "PREFIX ns2: <urn:polygene:type:org.apache.polygene.test.indexing.model.Nameable#> \n" + + "PREFIX ns0: <urn:polygene:type:org.apache.polygene.api.identity.HasIdentity#> \n" + + "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> \n" + + "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> \n" + "SELECT DISTINCT ?reference\n" + + "WHERE {\n" + "?entityType rdfs:subClassOf <urn:polygene:type:org.apache.polygene.test.indexing.model.Person>. \n" + + "?entity rdf:type ?entityType. \n" + "?entity ns0:identity ?reference. \n" + + "?entity ns1:placeOfBirth ?v0. \n" + "?v0 ns2:name ?v1. \n" + "?entity ns1:yearOfBirth ?v2. \n" + "\n" + + "}", // script21 +</pre><pre class="programlisting brush: java">"PREFIX ns1: <urn:polygene:type:org.apache.polygene.test.indexing.model.Nameable#> \n" + + "PREFIX ns0: <urn:polygene:type:org.apache.polygene.api.identity.HasIdentity#> \n" + + "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> \n" + + "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> \n" + "SELECT DISTINCT ?reference\n" + + "WHERE {\n" + "?entityType rdfs:subClassOf <urn:polygene:type:org.apache.polygene.test.indexing.model.Nameable>. \n" + + "?entity rdf:type ?entityType. \n" + "?entity ns0:identity ?reference. \n" + "?entity ns1:name ?v0. \n" + + "FILTER regex(?v0,\"J.*Doe\")\n" + "}", // script22 +</pre><pre class="programlisting brush: java">"PREFIX ns1: <urn:polygene:type:org.apache.polygene.test.indexing.model.Nameable#> \n" + + "PREFIX ns0: <urn:polygene:type:org.apache.polygene.api.identity.HasIdentity#> \n" + + "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> \n" + + "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> \n" + "SELECT DISTINCT ?reference\n" + + "WHERE {\n" + "?entityType rdfs:subClassOf <urn:polygene:type:org.apache.polygene.test.indexing.model.Domain>. \n" + + "?entity rdf:type ?entityType. \n" + "?entity ns0:identity ?reference. \n" + "?entity ns1:name ?v0. \n" + + "FILTER (?v0 = ?domain)\n" + "}" // script24 +</pre></div></div><div xmlns="" xmlns:exsl="http://exslt.org/common" class="footer"><p> + Copyright © 2015 The Apache Software Foundation, Licensed under the <a href="http://www.apache.org/licenses/" target="_blank">Apache License, Version 2.0</a>. + <br /><small> + Apache Polygene, Polygene, Apache, the Apache feather logo, and the Apache Polygene project logo are trademarks of The Apache Software Foundation.<br /> + All other marks mentioned may be trademarks or registered trademarks of their respective owners. + </small></p></div></body></html> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/polygene-website/blob/ba3a0fac/content/java/develop/extension-index-solr.html ---------------------------------------------------------------------- diff --git a/content/java/develop/extension-index-solr.html b/content/java/develop/extension-index-solr.html new file mode 100644 index 0000000..793dc7c --- /dev/null +++ b/content/java/develop/extension-index-solr.html @@ -0,0 +1,76 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Apache Solr Index/Query</title><link rel="stylesheet" type="text/css" href="css/style.css" /><meta name="generator" content="DocBook XSL Stylesheets V1.76.1" /><link rel="home" href="index.html" title="" /><link rel="up" href="extensions.html" title="Extensions" /><link rel="prev" href="extension-index-rdf.html" title="OpenRDF Index/Query" /><link rel="next" href="extension-indexing-sql.html" title="SQL Index/Query" /> + + +<!-- favicon --> + +<link rel="shortcut icon" href="http://polygene.apache.org/favicon.ico" type="image/vnd.microsoft.icon" /> +<link rel="icon" href="http://polygene.apache.org/favicon.ico" type="image/x-icon" /> + +<!-- style --> + +<link href="css/shCore.css" rel="stylesheet" type="text/css" /> +<link href="css/shCoreEclipse.css" rel="stylesheet" type="text/css" /> +<link href="css/shThemeEclipse.css" rel="stylesheet" type="text/css" /> +<link href="css/polygene.css" rel="stylesheet" type="text/css" /> + +<!-- Syntax Highlighter --> + +<script type="text/javascript" src="js/shCore.js"></script> +<script type="text/javascript" src="js/shBrushJava.js"></script> +<script type="text/javascript" src="js/shBrushScala.js"></script> +<script type="text/javascript" src="js/shBrushJScript.js"></script> +<script type="text/javascript" src="js/shBrushBash.js"></script> +<script type="text/javascript" src="js/shBrushPlain.js"></script> +<script type="text/javascript" src="js/shBrushXml.js"></script> +<script type="text/javascript" src="js/shBrushGroovy.js"></script> +<script type="text/javascript" src="js/shBrushPython.js"></script> +<script type="text/javascript" src="js/shBrushRuby.js"></script> +<script type="text/javascript" src="js/shBrushCSharp.js"></script> + +<script type="text/javascript"> + SyntaxHighlighter.defaults['tab-size'] = 4; + SyntaxHighlighter.defaults['gutter'] = false; + SyntaxHighlighter.defaults['toolbar'] = false; + SyntaxHighlighter.all() +</script> + +<!-- JQuery --> + +<script type="text/javascript" src="js/jquery-1.6.4.min.js"></script> + +<!-- Image Scaler --> + +<script type="text/javascript" src="js/imagescaler.js"></script> + +<!-- Table Styler --> + +<script type="text/javascript" src="js/tablestyler.js"></script> + +<!-- Apache Polygene WebSite Progressive Enhancement --> + +<link href="css/progressive-enhancement.css" rel="stylesheet" type="text/css" /> +<script type="text/javascript" src="js/jquery.scrollTo-1.4.2.js"></script> +<script type="text/javascript" src="js/progressive-enhancement.js"></script> + +<!-- Analytics --> + <script type="text/javascript"> + var _gaq = _gaq || []; + _gaq.push(['_setAccount', 'UA-62007352-1']); + _gaq.push(['_trackPageview']); + + (function() { + var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; + ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; + var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); + })(); + </script> + + </head><body><div xmlns="" xmlns:exsl="http://exslt.org/common" class="logo"><a href="index.html"><img src="images/logo-standard.png" /></a></div><div xmlns="" xmlns:exsl="http://exslt.org/common" class="top-nav"><div xmlns="http://www.w3.org/1999/xhtml" class="toc"><dl><dt><span class="section"><a href="index.html#home">Polygeneâ¢</a></span></dt><dt><span class="section"><a href="intro.html">Introduction</a></span></dt><dt><span class="section"><a href="tutorials.html">Tutorials</a></span></dt><dt><span class="section"><a href="javadocs.html">Javadoc</a></span></dt><dt><span class="section"><a href="samples.html">Samples</a></span></dt><dt><span class="section"><a href="core.html">Core</a></span></dt><dt><span class="section"><a href="libraries.html">Libraries</a></span></dt><dt><span class="section"><span xmlns="" href="extensions.html">Extensions</span></span></dt><dt><span class="section"><a href="tools.html">Tools</a></span></dt><dt><span class="section"><a href="glossary.ht ml">Glossary </a></span></dt></dl></div></div><div xmlns="" xmlns:exsl="http://exslt.org/common" class="sub-nav"><div xmlns="http://www.w3.org/1999/xhtml" class="toc"><dl><dt><span class="section"><a href="extensions.html#_overview_7">Overview</a></span></dt><dt><span class="section"><a href="extension-vs-orgjson.html">org.json ValueSerialization</a></span></dt><dt><span class="section"><a href="extension-vs-jackson.html">Jackson ValueSerialization</a></span></dt><dt><span class="section"><a href="extension-vs-stax.html">StAX ValueSerialization</a></span></dt><dt><span class="section"><a href="extension-cache-ehcache.html">Ehcache Cache</a></span></dt><dt><span class="section"><a href="extension-cache-memcache.html">Memcache Cache</a></span></dt><dt><span class="section"><a href="extension-es-memory.html">Memory EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-file.html">File EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-geode. html">Geode EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-hazelcast.html">Hazelcast EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-jclouds.html">JClouds EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-jdbm.html">JDBM EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-leveldb.html">LevelDB EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-mongodb.html">MongoDB EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-preferences.html">Preferences EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-redis.html">Redis EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-riak.html">Riak EntityStore</a></span></dt><dt><span class="section"><a href="extension-es-sql.html">SQL EntityStore</a></span></dt><dt><span class="section"><a href="extension-index-elasticsearch.html">ElasticSearch Index/Query< /a></span></dt><dt><span class="section"><a href="extension-index-rdf.html">OpenRDF Index/Query</a></span></dt><dt><span class="section"><span xmlns="" href="extension-index-solr.html">Apache Solr Index/Query</span></span></dt><dt><span class="section"><a href="extension-indexing-sql.html">SQL Index/Query</a></span></dt><dt><span class="section"><a href="extension-metrics-metrics.html">Codahale Metrics</a></span></dt><dt><span class="section"><a href="extension-migration.html">Migration</a></span></dt><dt><span class="section"><a href="extension-reindexer.html">Reindexer</a></span></dt></dl></div></div><div class="section" title="Apache Solr Index/Query"><div class="titlepage"><div><div><h3 class="title"><a id="extension-index-solr"></a>Apache Solr Index/Query</h3></div></div></div><p class="remark"><em><span class="comment"></span></em></p><p class="devstatus-code-stable">code</p><p class="devstatus-docs-brief">docs</p><p class="devstatus-tests-some">tests</p><p>Index/Query service s backed by an embedded <a class="ulink" href="http://lucene.apache.org/solr/" target="_top">Apache Solr Search</a>.</p><div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>Solr Index/Query service do not support the Polygene⢠Query API but only native Solr queries.</p></div><div class="section" title="Assembly"><div class="titlepage"><div><div><h4 class="title"><a id="_assembly_25"></a>Assembly</h4></div></div></div><p>Assembly is done using the provided Assembler:</p><pre class="programlisting brush: java">new SolrAssembler().assemble( module ); +</pre></div><div class="section" title="Configuration"><div class="titlepage"><div><div><h4 class="title"><a id="_configuration_20"></a>Configuration</h4></div></div></div><p>Apache Solr Index/Query exclusively use the <a class="xref" href="library-fileconfig.html" title="FileConfig">FileConfig Library</a> to locate the directory where it persists its index.</p><p>You must provide <code class="literal">solrconfig.xml</code> and <code class="literal">schema.xml</code> files either from the classpath or in the configuration directory of +the <a class="xref" href="library-fileconfig.html" title="FileConfig">FileConfig Library</a>.</p></div></div><div xmlns="" xmlns:exsl="http://exslt.org/common" class="footer"><p> + Copyright © 2015 The Apache Software Foundation, Licensed under the <a href="http://www.apache.org/licenses/" target="_blank">Apache License, Version 2.0</a>. + <br /><small> + Apache Polygene, Polygene, Apache, the Apache feather logo, and the Apache Polygene project logo are trademarks of The Apache Software Foundation.<br /> + All other marks mentioned may be trademarks or registered trademarks of their respective owners. + </small></p></div></body></html> \ No newline at end of file
