Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 3B82B200C7D for ; Mon, 17 Apr 2017 03:56:03 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 3A3E2160B9D; Mon, 17 Apr 2017 01:56:03 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 7820E160BC2 for ; Mon, 17 Apr 2017 03:56:00 +0200 (CEST) Received: (qmail 3056 invoked by uid 500); 17 Apr 2017 01:55:59 -0000 Mailing-List: contact commits-help@polygene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@polygene.apache.org Delivered-To: mailing list commits@polygene.apache.org Received: (qmail 2161 invoked by uid 99); 17 Apr 2017 01:55:56 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Apr 2017 01:55:56 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 8C653F17B3; Mon, 17 Apr 2017 01:55:56 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: niclas@apache.org To: commits@polygene.apache.org Date: Mon, 17 Apr 2017 01:56:14 -0000 Message-Id: <27fa65faf62f4e3d8bb6c52b28024c38@git.apache.org> In-Reply-To: <909f72376fd1475cb2ebde44b56b8d0b@git.apache.org> References: <909f72376fd1475cb2ebde44b56b8d0b@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [20/36] polygene-website git commit: Working on new website. archived-at: Mon, 17 Apr 2017 01:56:03 -0000 http://git-wip-us.apache.org/repos/asf/polygene-website/blob/bb9c9971/content/java/2017/extension-es-sql.html ---------------------------------------------------------------------- diff --git a/content/java/2017/extension-es-sql.html b/content/java/2017/extension-es-sql.html new file mode 100644 index 0000000..61d8967 --- /dev/null +++ b/content/java/2017/extension-es-sql.html @@ -0,0 +1,393 @@ + +SQL EntityStore + + + + + + + + + + + Starter Template for Bootstrap + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

SQL EntityStore

code

docs

tests

EntityStore service backed by a SQL database.

This extension fully leverage the SQL Library meaning that you must use it to assemble your DataSource and that you +get Circuit Breaker and JMX integration for free.

The database schema is managed using ???.

Tip

See the SQL Support Sample that demonstrate combined use of SQL Library, SQL EntityStore and +SQL Index/Query.

The following SQL databases are supported:

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.

Table 62. Artifact

Group IDArtifact IDVersion

org.apache.polygene.extensions

org.apache.polygene.extension.entitystore-sql

0


Configuration

Here are the available configuration properties:

public interface SQLMapEntityStoreConfiguratio
 n extends SQLConfiguration
+{
+    /**
+     * Name of the database schema to use.
+     * Ignored on SQL databases that don't support schemas.
+     */
+    @UseDefaults( "POLYGENE_ES" )
+    @Override
+    Property<String> schemaName();
+
+    /**
+     * Name of the entities table.
+     */
+    @UseDefaults( "POLYGENE_ENTITIES" )
+    Property<String> entityTableName();
+
+    /**
+     * Defines whether the database schema and table should be created if not already present.
+     */
+    @UseDefaults( "true" )
+    Property<Boolean> createIfMissing();
+}
+

The assembly snippets below show the DataSource assembly alongside the SQL EntityStore assembly. Remember to configure +the DataSource properly, see SQL Library and Configure a Service.

PostgreSQL

Maximum number of entities is unlimited.

Assembly is done using the provided Assembler:

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 );
+          [...snip...]
+
+}
+

Sample DataSource configuration defaults:

#
+#  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
+driver=org.postgresql.Driver
+username=jdbc_test_login
+password=password

MySQL and MariaDB

Maximum number of entities depends on the choosen storage engine.

Assembly is done using the provided Assembler:

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 );
+          [...snip...]
+
+}
+

Sample DataSource configuration defaults:

#
+#  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=false&useLegacyDatetimeCode=false&serverTimezone=UTC&nullCatalogMeansCurrent=true&nullNamePatternMatchesAll=true
+driver=com.mysql.cj.jdbc.Driver
+username=root
+password=

SQLite

Maximum number of entities is unlimited.

The Xerial SQLite JDBC driver is recommended. +It provides native support on Linux, Windows and MaxOSX, pure Java on other OSes.

Assembly is done using the provided Assembler:

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 );
+}
+

Sample DataSource configuration defaults:

#
+#  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=

H2 Database Engine

Maximum number of entities is 2^64.

Assembly is done using the provided Assembler:

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 );
+}
+

Sample DataSource configuration defaults:

#
+#  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=

Apache Derby and Oracle JavaDB

Maximum number of entities is unlimited.

Assembly is done using the provided Assembler:

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 );
+}
+

Sample DataSource configuration defaults:

#
+#  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=

Copyright © 2017 The Apache Software Foundation, Licensed under the Apache License, Version 2.0. + Apache Polygene, Polygene, Apache, the Apache feather logo, and the Apache Polygene project logo are + trademarks of The Apache Software Foundation. + All other marks mentioned may be trademarks or registered trademarks of their respective owners. +

\ No newline at end of file http://git-wip-us.apache.org/repos/asf/polygene-website/blob/bb9c9971/content/java/2017/extension-index-elasticsearch.html ---------------------------------------------------------------------- diff --git a/content/java/2017/extension-index-elasticsearch.html b/content/java/2017/extension-index-elasticsearch.html new file mode 100644 index 0000000..64a3954 --- /dev/null +++ b/content/java/2017/extension-index-elasticsearch.html @@ -0,0 +1,214 @@ + +ElasticSearch Index/Query + + + + + + + + + + + Starter Template for Bootstrap + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

ElasticSearch Index/Query

code

docs

tests

Index/Query services backed by ElasticSearch search engine built on top of +Apache Lucene.

Warning

ElasticSearch Index/Query do not support ComplexQueries from the Query API, ie. queries by "example value".

Three modes of operation are supported:

  • +embedded local only filesystem based node ; +
  • +managed cluster client ; +
  • +with a provided client. +

In any case, Lucene hard limits apply. +See the Lucene File Format +documentation about maximum index size and document count. +Moreover, each field cannot be larger than 32766 bytes in its serialized form.

Table 65. Artifact

Group IDArtifact IDVersion

org.apache.polygene.extensions

org.apache.polygene.extension.indexing-elasticsearch

0


Embedded on local file system

Filesystem based ElasticSearch Index/Query service relies on the FileConfig Library to decide where it stores its +index data, transaction logs etc…

Assembly is done using the provided Assembler:

new ESFilesystemIndexQueryAssembler()
+    .withConfig( configModule, configVisibility )
+    .assemble( module );
+
Configuration

Important

By default queries can only traverse Aggregated Associations, if you want to be able to traverse all +Associations set the indexNonAggregatedAssociations configuration property to TRUE.

Here are the configuration properties for the filesystem ElasticSearch Index/Query services:

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();
+
+}
+

All configuration properties are defaulted meaning that you can use ElasticSearch Index/Query service without +configuration.

In an ElasticSearch cluster

Assembly

Assembly is done using the provided Assembler:

new ESClusterIndexQueryAssembler()
+    .withConfig( configModule, configVisibility )
+    .assemble( module );
+
Configuration

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.

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();
+
+}
+

Again, all configuration properties are defaulted meaning that you can use ElasticSearch Index/Query service without +configuration.

Using a provided client

Assembly

Assembly is done using the provided Assembler:

new ESClientIndexQueryAssembler( client )
+    .withConfig( configModule, configVisibility )
+    .assemble( module );
+
Configuration

Here are the configuration properties for the ElasticSearch Index/Query service using a provided client. +Note that the clusterName is ignored as this is managed by the client.

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();
+
+}
+

Again, all configuration properties are defaulted meaning that you can use ElasticSearch Index/Query service without +configuration.

Copyright © 2017 The Apache Software Foundation, Licensed under the Apache License, Version 2.0. + Apache Polygene, Polygene, Apache, the Apache feather logo, and the Apache Polygene project logo are + trademarks of The Apache Software Foundation. + All other marks mentioned may be trademarks or registered trademarks of their respective owners. +

\ No newline at end of file http://git-wip-us.apache.org/repos/asf/polygene-website/blob/bb9c9971/content/java/2017/extension-index-rdf.html ---------------------------------------------------------------------- diff --git a/content/java/2017/extension-index-rdf.html b/content/java/2017/extension-index-rdf.html new file mode 100644 index 0000000..2f0dd8c --- /dev/null +++ b/content/java/2017/extension-index-rdf.html @@ -0,0 +1,288 @@ + +OpenRDF Index/Query + + + + + + + + + + + Starter Template for Bootstrap + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

OpenRDF Index/Query

code

docs

tests

Index/Query services backed by OpenRDF Sesame framework for processing RDF data.

Table 66. Artifact

Group IDArtifact IDVersion

org.apache.polygene.extensions

org.apache.polygene.extension.indexing-rdf

0


In Memory

Assembly is done using the provided Assembler:

new RdfMemoryStoreAssembler().assemble( module 
 );
+

No configuration needed.

On Filesystem

Assembly

Assembly is done using the provided Assembler:

new RdfNativeSesameStoreAssembler().assemble( module );
+
Configuration

Here are the configuration properties for the Native RDF Index/Query:

public interface NativeConfiguration extends ConfigurationComposite
+{
+    @Optional @Matches( "([spoc][spoc][spoc][spoc],?)*" ) Property<String> tripleIndexes();
+
+    @Optional Property<String> dataDirectory();
+
+    @UseDefaults Property<Boolean> forceSync();
+}
+

In a RDBMS

Assembly

Assembly is done using the provided Assembler:

new RdfRdbmsSesameStoreAssembler().assemble( module );
+
Configuration

Here are the configuration properties for the RDBMS based RDF Index/Query:

public interface RdbmsRepositoryConfiguration
+{
+    Property<String> jdbcDriver();
+    Property<String> jdbcUrl();
+    Property<String> user();
+    Property<String> password();
+}
+

Named RDF Queries

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.

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.

"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.model.Person>. \n"
+    + "?entity rdf:type ?entityType. \n" + "?entity ns0:identity ?reference. \n" + "\n" + "}", // script01
+
"PREFIX ns1: <urn:polygene:type:org.apache.polygene.test.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.model.Domain>. \n"
+    + "?entity rdf:type ?entityType. \n" + "?entity ns0:identity ?reference. \n" + "?entity ns1:name ?v0. \n"
+    + "FILTER (?v0 = \"Gaming\")\n" + "}", // script02
+
"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.model.Nameable>. \n"
+    + "?entity rdf:type ?entityType. \n" + "?entity ns0:identity ?reference. \n" + "\n" + "}", // script03
+
"PREFIX ns1: <urn:polygene:type:org.apache.polygene.test.model.Person#> \n"
+    + "PREFIX ns2: <urn:polygene:type:org.apache.polygene.test.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.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
+
"PREFIX ns1: <urn:polygene:type:org.apache.polygene.test.model.Person#> \n"
+    + "PREFIX ns2: <urn:polygene:type:org.apache.polygene.test.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.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
+
"PREFIX ns1: <urn:polygene:type:org.apache.polygene.test.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.model.Person>. \n"
+    + "?entity rdf:type ?entityType. \n" + "?entity ns0:identity ?reference. \n"
+    + "?entity ns1:yearOfBirth ?v0. \n" + "FILTER (?v0 >= \"1973\")\n" + "}", // script06
+
"PREFIX ns1: <urn:polygene:type:org.apache.polygene.test.model.Person#> \n"
+    + "PREFIX ns2: <urn:polygene:type:org.apache.polygene.test.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.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
+
"PREFIX ns1: <urn:polygene:type:org.apache.polygene.test.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.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
+
"PREFIX ns1: <urn:polygene:type:org.apache.polygene.test.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.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
+
"PREFIX ns1: <urn:polygene:type:org.apache.polygene.test.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.model.Person>. \n"
+    + "?entity rdf:type ?entityType. \n" + "?entity ns0:identity ?reference. \n"
+    + "?entity ns1:yearOfBirth ?v0. \n" + "FILTER (!(?v0 = \"1975\"))\n" + "}", // script10
+
"PREFIX ns1: <urn:polygene:type:org.apache.polygene.test.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.model.Person>. \n"
+    + "?entity rdf:type ?entityType. \n" + "?entity ns0:identity ?reference. \n"
+    + "OPTIONAL {?entity ns1:email ?v0}. \n" + "FILTER (bound(?v0))\n" + "}", // script11
+
"PREFIX ns1: <urn:polygene:type:org.apache.polygene.test.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.model.Person>. \n"
+    + "?entity rdf:type ?entityType. \n" + "?entity ns0:identity ?reference. \n"
+    + "OPTIONAL {?entity ns1:email ?v0}. \n" + "FILTER (! bound(?v0))\n" + "}", // script12
+
"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.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.model.Person>. \n"
+    + "?entity rdf:type ?entityType. \n" + "?entity ns0:identity ?reference. \n"
+    + "OPTIONAL {?entity ns1:wife ?v0}. \n" + "FILTER (bound(?v0))\n" + "}", // script13
+
"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.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.model.Male>. \n"
+    + "?entity rdf:type ?entityType. \n" + "?entity ns0:identity ?reference. \n"
+    + "OPTIONAL {?entity ns1:wife ?v0}. \n" + "FILTER (! bound(?v0))\n" + "}", // script14
+
"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.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.model.Person>. \n"
+    + "?entity rdf:type ?entityType. \n" + "?entity ns0:identity ?reference. \n"
+    + "OPTIONAL {?entity ns1:wife ?v0}. \n" + "FILTER (! bound(?v0))\n" + "}", // script15
+
"PREFIX ns1: <urn:polygene:type:org.apache.polygene.test.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.model.Nameable>. \n"
+    + "?entity rdf:type ?entityType. \n" + "?entity ns0:identity ?reference. \n" + "?entity ns1:name ?v0. \n"
+    + "\n" + "}", // script16
+
"PREFIX ns1: <urn:polygene:type:org.apache.polygene.test.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.model.Nameable>. \n"
+    + "?entity rdf:type ?entityType. \n" + "?entity ns0:identity ?reference. \n" + "?entity ns1:name ?v0. \n"
+    + "\n" + "} ", // script17
+
"PREFIX ns1: <urn:polygene:type:org.apache.polygene.test.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.model.Nameable>. \n"
+    + "?entity rdf:type ?entityType. \n" + "?entity ns0:identity ?reference. \n" + "?entity ns1:name ?v0. \n"
+    + "\n" + "}\n", // script18
+
"PREFIX ns1: <urn:polygene:type:org.apache.polygene.test.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.model.Nameable>. \n"
+    + "?entity rdf:type ?entityType. \n" + "?entity ns0:identity ?reference. \n" + "?entity ns1:name ?v0. \n"
+    + "FILTER (?v0 > \"D\")\n" + "} ", // script19
+
"PREFIX ns1: <urn:polygene:type:org.apache.polygene.test.model.Person#> \n"
+    + "PREFIX ns2: <urn:polygene:type:org.apache.polygene.test.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.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
+
"PREFIX ns1: <urn:polygene:type:org.apache.polygene.test.model.Person#> \n"
+    + "PREFIX ns2: <urn:polygene:type:org.apache.polygene.test.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.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
+
"PREFIX ns1: <urn:polygene:type:org.apache.polygene.test.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.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
+
"PREFIX ns1: <urn:polygene:type:org.apache.polygene.test.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.model.Domain>. \n"
+    + "?entity rdf:type ?entityType. \n" + "?entity ns0:identity ?reference. \n" + "?entity ns1:name ?v0. \n"
+    + "FILTER (?v0 = ?domain)\n" + "}" // script24
+

Copyright © 2017 The Apache Software Foundation, Licensed under the Apache License, Version 2.0. + Apache Polygene, Polygene, Apache, the Apache feather logo, and the Apache Polygene project logo are + trademarks of The Apache Software Foundation. + All other marks mentioned may be trademarks or registered trademarks of their respective owners. +

\ No newline at end of file http://git-wip-us.apache.org/repos/asf/polygene-website/blob/bb9c9971/content/java/2017/extension-index-solr.html ---------------------------------------------------------------------- diff --git a/content/java/2017/extension-index-solr.html b/content/java/2017/extension-index-solr.html new file mode 100644 index 0000000..8d26e84 --- /dev/null +++ b/content/java/2017/extension-index-solr.html @@ -0,0 +1,105 @@ + +Apache Solr Index/Query + + + + + + + + + + + Starter Template for Bootstrap + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Apache Solr Index/Query

code

docs

tests

Index/Query services backed by an embedded Apache Solr Search.

Warning

Solr Index/Query service do not support the Polygene™ Query API but only native Solr queries.

Table 67. Artifact

Group IDArtifact IDVersion

org.apache.polygene.extensions

org.apache.polygene.extension.indexing-solr

0


Assembly

Assembly is done using the provided Assembler:

new SolrIndexingAssembler().assemble( module );
+

Configuration

Apache Solr Index/Query exclusively use the FileConfig Library to locate the directory where it persists its index.

You must provide solrconfig.xml and schema.xml files either from the classpath or in the configuration directory of +the FileConfig Library.

Copyright © 2017 The Apache Software Foundation, Licensed under the Apache License, Version 2.0. + Apache Polygene, Polygene, Apache, the Apache feather logo, and the Apache Polygene project logo are + trademarks of The Apache Software Foundation. + All other marks mentioned may be trademarks or registered trademarks of their respective owners. +

\ No newline at end of file