├── .gitignore ├── core └── ELK │ ├── logstash-config │ ├── patterns │ │ └── httpry.pattern │ └── logstash.conf │ ├── logstash-ssl │ ├── logstash-forwarder.crt │ └── logstash-forwarder.key │ └── logstash-forwarder.conf ├── marmotta ├── boot-scripts │ └── 02-marmotta-backend.js └── docker-compose.yml ├── virtuoso ├── docker-compose.yml ├── fp3_vos_setup.template.sql ├── README.md ├── boot-scripts │ └── 03-virtuoso-backend.js └── virtuoso.fp3_template.ini ├── boot-scripts ├── 09-init-stanbol.js └── 10-init-pundit.js ├── docker-compose-commons.yml ├── README.md └── LICENSE /.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | -------------------------------------------------------------------------------- /core/ELK/logstash-config/patterns/httpry.pattern: -------------------------------------------------------------------------------- 1 | HTTPRY %{IP:client}\t%{GREEDYDATA:port}\t%{GREEDYDATA:request} 2 | -------------------------------------------------------------------------------- /marmotta/boot-scripts/02-marmotta-backend.js: -------------------------------------------------------------------------------- 1 | /* global P3BackendConfigurator */ 2 | 3 | (function() { 4 | var host = window.location.hostname; 5 | P3BackendConfigurator.prototype.serviceHost = host; 6 | 7 | P3BackendConfigurator.prototype.getLdpRoot = function() { 8 | return new Promise(function(resolve, reject) { 9 | resolve("http://"+host+":8181/ldp"); 10 | }); 11 | }; 12 | })(); 13 | -------------------------------------------------------------------------------- /core/ELK/logstash-config/logstash.conf: -------------------------------------------------------------------------------- 1 | input { 2 | lumberjack { 3 | port => 5043 4 | type => "logs" 5 | ssl_certificate => "/etc/ssl/logstash-forwarder.crt" 6 | ssl_key => "/etc/ssl/logstash-forwarder.key" 7 | } 8 | } 9 | 10 | filter { 11 | 12 | grok { 13 | add_field => { 14 | "request"=> "%{request}" 15 | "client-ip" => "%{client}" 16 | } 17 | 18 | patterns_dir => "/etc/logstash/patterns" 19 | pattern => "%{HTTPRY}" 20 | 21 | 22 | } 23 | 24 | 25 | geoip { 26 | source => "client-ip" 27 | target => "geoip" 28 | add_field => [ "[geoip][coordinates]", "%{[geoip][longitude]}" ] 29 | add_field => [ "[geoip][coordinates]", "%{[geoip][latitude]}" ] 30 | } 31 | mutate { 32 | convert => [ "[geoip][coordinates]", "float" ] 33 | } 34 | 35 | } 36 | 37 | 38 | output { 39 | elasticsearch { 40 | protocol => http 41 | } 42 | stdout { codec => rubydebug } 43 | } 44 | -------------------------------------------------------------------------------- /core/ELK/logstash-ssl/logstash-forwarder.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIC7zCCAdegAwIBAgIJAIPBpH7wCfwFMA0GCSqGSIb3DQEBCwUAMA4xDDAKBgNV 3 | BAMMA2VsazAeFw0xNTEwMTIxNDA2NTNaFw0yNTEwMDkxNDA2NTNaMA4xDDAKBgNV 4 | BAMMA2VsazCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL1CVtovtY57 5 | p2FYyKvdR3SMbynnYsDK4JTGaHc4H1j6l5ai2EJEpQ3U79InwC4EbVjX7DAYPDv9 6 | qlXJTU4u3E02GevSvH/u4dXArw/go/gmuGxfNMAcrEtOxJ/1owxIogwfdeA3DBXg 7 | dABmxIynecOpsgW5bVJxLYcLvv8ksEAkPUsICo1Aaw5vofRKDVaZvp2W39k1io+Q 8 | vYJt7UME9rMk9VhSNuwn7lCabFxxm7bfRRmke3dKKzqC/J9n8qBC7kbPsWTUsTgj 9 | YeLt6HBRh42CZ1I4ixNXRFhgdoJwojbLN22oKSK2ttNuZjvguv9tmwD4HUAgIbrZ 10 | TbDee6mP7SECAwEAAaNQME4wHQYDVR0OBBYEFPNGqF+taz34Jt2IfIfjWF7ZLFiT 11 | MB8GA1UdIwQYMBaAFPNGqF+taz34Jt2IfIfjWF7ZLFiTMAwGA1UdEwQFMAMBAf8w 12 | DQYJKoZIhvcNAQELBQADggEBAD8spUogEPqZzDAyGRV/aGM0LodJZcfk3uSRiyvk 13 | ZNi7sJoOe7eTqTGoXf04WLJu3ZNcIN8l7uFXVSZCan/K+rri3zluv5tN7nTNZAmw 14 | czLgMJR+mbYHxjEvtxdNFg1qQw6DRw8xIJUvt1CV84zlgsBHMhPKU+NnnGicW6bu 15 | K7P0RcwI3D3jdQJPIS6cR8QE3sAxYoiXIKoE+DvDpyEfZ2rr+RlAQh20Uk50Q5Qy 16 | Zpz7TtMMfcI4RsgSlcNkOK9WxEf/UsxGO6gbW7asFVoYkUxErwdOrz1BernRd3LK 17 | wh158Ya4FigJU2Fd66Ht1G94V/q2vtgghB9Dr65Ohw886Lc= 18 | -----END CERTIFICATE----- 19 | -------------------------------------------------------------------------------- /virtuoso/docker-compose.yml: -------------------------------------------------------------------------------- 1 | logdata: 2 | extends: 3 | file: ../docker-compose-commons.yml 4 | service: logdata 5 | 6 | entry: 7 | extends: 8 | file: ../docker-compose-commons.yml 9 | service: entry 10 | volumes: 11 | - ./boot-scripts/03-virtuoso-backend.js:/etc/fusepool-p3/boot-scripts/03-virtuoso-backend.js 12 | 13 | vos: 14 | image: openlink/virtuoso_opensource:vos 15 | ports: 16 | - "1111:1111" 17 | - "8890:8890" 18 | volumes: 19 | - /opt/virtuoso-opensource/var/lib/virtuoso/db:/opt/virtuoso-opensource/var/lib/virtuoso/db 20 | 21 | core: 22 | extends: 23 | file: ../docker-compose-commons.yml 24 | service: core 25 | links: 26 | - elk 27 | - vos:ldp 28 | volumes_from: 29 | - logdata 30 | environment: 31 | - LDPURI=http://ldp:8890/ 32 | 33 | stanbol: 34 | extends: 35 | file: ../docker-compose-commons.yml 36 | service: stanbol 37 | 38 | batchrefine: 39 | extends: 40 | file: ../docker-compose-commons.yml 41 | service: batchrefine 42 | volumes_from: 43 | - logdata 44 | 45 | openrefine: 46 | extends: 47 | file: ../docker-compose-commons.yml 48 | service: openrefine 49 | volumes_from: 50 | - logdata 51 | 52 | elk: 53 | extends: 54 | file: ../docker-compose-commons.yml 55 | service: elk 56 | 57 | pundittransformer: 58 | extends: 59 | file: ../docker-compose-commons.yml 60 | service: pundittransformer 61 | links: 62 | - core 63 | - vos:ldp 64 | - entry -------------------------------------------------------------------------------- /marmotta/docker-compose.yml: -------------------------------------------------------------------------------- 1 | logdata: 2 | extends: 3 | file: ../docker-compose-commons.yml 4 | service: logdata 5 | 6 | entry: 7 | extends: 8 | file: ../docker-compose-commons.yml 9 | service: entry 10 | volumes: 11 | - ./boot-scripts/02-marmotta-backend.js:/etc/fusepool-p3/boot-scripts/02-marmotta-backend.js 12 | 13 | marmotta: 14 | image: fusepoolp3/ldp-marmotta 15 | restart: unless-stopped 16 | # links: 17 | # - postgres 18 | 19 | #postgres: 20 | # image: postgres 21 | # restart: unless-stopped 22 | # environment: 23 | # - POSTGRES_PASSWORD=myFancyPassword 24 | 25 | core: 26 | extends: 27 | file: ../docker-compose-commons.yml 28 | service: core 29 | links: 30 | - elk 31 | - marmotta:ldp 32 | volumes_from: 33 | - logdata 34 | environment: 35 | - LDPURI=http://ldp:8080/ 36 | 37 | stanbol: 38 | extends: 39 | file: ../docker-compose-commons.yml 40 | service: stanbol 41 | 42 | batchrefine: 43 | extends: 44 | file: ../docker-compose-commons.yml 45 | service: batchrefine 46 | volumes_from: 47 | - logdata 48 | 49 | openrefine: 50 | extends: 51 | file: ../docker-compose-commons.yml 52 | service: openrefine 53 | volumes_from: 54 | - logdata 55 | 56 | elk: 57 | extends: 58 | file: ../docker-compose-commons.yml 59 | service: elk 60 | 61 | pundittransformer: 62 | extends: 63 | file: ../docker-compose-commons.yml 64 | service: pundittransformer 65 | environment: 66 | - LDPURI=http://ldp:8080/ 67 | links: 68 | - core 69 | - marmotta:ldp 70 | - entry 71 | -------------------------------------------------------------------------------- /boot-scripts/09-init-stanbol.js: -------------------------------------------------------------------------------- 1 | /* global P3BackendConfigurator, Promise */ 2 | 3 | (function() { 4 | var configureStanbol = function (stanbolBase, platform) { 5 | var attemptsCounter = 0; 6 | var main = this; 7 | return new Promise(function (resolve, reject) { 8 | var attempt = function() { 9 | 10 | var getRequest = $.ajax({method: 'POST', 11 | url: stanbolBase + "fusepool/config/", 12 | data: {fusepool: platform}, 13 | async: true 14 | }); 15 | getRequest.done(function() { 16 | resolve(main); 17 | }); 18 | getRequest.fail(function() { 19 | if (attemptsCounter++ > 20) { 20 | reject(Error("Have been waiting for stanbol too long")); 21 | } else { 22 | console.log("Stanbol request failed, retrying...."); 23 | setTimeout(function(){ 24 | attempt(); 25 | }, 1000); 26 | } 27 | }); 28 | }; 29 | attempt(); 30 | }); 31 | }; 32 | var origFunction = P3BackendConfigurator.prototype.registerTransfomersAndFactories; 33 | P3BackendConfigurator.prototype.registerTransfomersAndFactories = function(platform) { 34 | var stanbolBase = "http://"+this.serviceHost+":8304/"; 35 | return Promise.all([ 36 | configureStanbol(stanbolBase , platform.getPlatformURI().toString()), 37 | origFunction.call(this, platform) 38 | ]); 39 | }; 40 | })(); 41 | 42 | -------------------------------------------------------------------------------- /boot-scripts/10-init-pundit.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | var configurePunditTransformer = function (punditTransformerBase, platform) { 3 | var attemptsCounter = 0; 4 | var main = this; 5 | return new Promise(function (resolve, reject) { 6 | var attempt = function() { 7 | 8 | var getRequest = $.ajax({method: 'POST', 9 | url: punditTransformerBase + "fusepool/config/", 10 | data: {fusepool: platform}, 11 | async: true 12 | }); 13 | getRequest.done(function() { 14 | resolve(main); 15 | }); 16 | getRequest.fail(function() { 17 | if (attemptsCounter++ > 20) { 18 | reject(Error("Have been waiting for punditTransformer too long")); 19 | } else { 20 | console.log("PunditTransformer request failed, retrying...."); 21 | setTimeout(function(){ 22 | attempt(); 23 | }, 1000); 24 | } 25 | }); 26 | }; 27 | attempt(); 28 | }); 29 | }; 30 | var origFunction = P3BackendConfigurator.prototype.registerTransfomersAndFactories; 31 | P3BackendConfigurator.prototype.registerTransfomersAndFactories = function(platform) { 32 | var punditTransformerBase = "http://"+this.serviceHost+":8386/"; 33 | return Promise.all([ 34 | configurePunditTransformer(punditTransformerBase , platform.getPlatformURI().toString()), 35 | origFunction.call(this, platform) 36 | ]); 37 | }; 38 | })(); 39 | 40 | -------------------------------------------------------------------------------- /core/ELK/logstash-forwarder.conf: -------------------------------------------------------------------------------- 1 | { 2 | # The network section covers network configuration :) 3 | "network": { 4 | # A list of downstream servers listening for our messages. 5 | # logstash-forwarder will pick one at random and only switch if 6 | # the selected one appears to be dead or unresponsive 7 | "servers": [ "elk:5043" ], 8 | 9 | # The path to your client ssl certificate (optional) 10 | # "ssl certificate": "/opt/ELK/logstash-ssl/logstash-forwarder.crt", 11 | "ssl certificate": "/etc/ssl/logstash-forwarder.crt", 12 | # The path to your client ssl key (optional) 13 | # "ssl key": "/opt/ELK/logstash-ssl/logstash-forwarder.key", 14 | "ssl key": "/etc/ssl/logstash-forwarder.key", 15 | 16 | # The path to your trusted ssl CA file. This is used 17 | # to authenticate your downstream server. 18 | # "ssl ca": "/opt/ELK/logstash-ssl/logstash-forwarder.crt", 19 | "ssl ca": "/etc/ssl/logstash-forwarder.crt", 20 | 21 | # Network timeout in seconds. This is most important for 22 | # logstash-forwarder determining whether to stop waiting for an 23 | # acknowledgement from the downstream server. If an timeout is reached, 24 | # logstash-forwarder will assume the connection or server is bad and 25 | # will connect to a server chosen at random from the servers list. 26 | "timeout": 15 27 | }, 28 | 29 | # The list of files configurations 30 | "files": [ 31 | # An array of hashes. Each hash tells what paths to watch and 32 | # what fields to annotate on events from those paths. 33 | { 34 | "paths": [ 35 | # single paths are fine 36 | "/var/log/httpry.log" 37 | ], 38 | 39 | # A dictionary of fields to annotate on each event. 40 | "fields": { "type": "syslog" } 41 | } 42 | ] 43 | } 44 | -------------------------------------------------------------------------------- /core/ELK/logstash-ssl/logstash-forwarder.key: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC9QlbaL7WOe6dh 3 | WMir3Ud0jG8p52LAyuCUxmh3OB9Y+peWothCRKUN1O/SJ8AuBG1Y1+wwGDw7/apV 4 | yU1OLtxNNhnr0rx/7uHVwK8P4KP4JrhsXzTAHKxLTsSf9aMMSKIMH3XgNwwV4HQA 5 | ZsSMp3nDqbIFuW1ScS2HC77/JLBAJD1LCAqNQGsOb6H0Sg1Wmb6dlt/ZNYqPkL2C 6 | be1DBPazJPVYUjbsJ+5QmmxccZu230UZpHt3Sis6gvyfZ/KgQu5Gz7Fk1LE4I2Hi 7 | 7ehwUYeNgmdSOIsTV0RYYHaCcKI2yzdtqCkitrbTbmY74Lr/bZsA+B1AICG62U2w 8 | 3nupj+0hAgMBAAECggEAf9mAsoPoMgh2WdyQMwmYa7MypSwaGgLzE420pFTVWFZw 9 | cOIxFRMqLN3b5CvWNz/mXk3+z76Pcjc6Chmij144lDAn8pa5n/LPvIYdvKwUGF6P 10 | 1yW5jM3R1k2vph9ZtcKbNXVLO9vz3hNySZMi06GPMA5CpHtOzpKGHuRgchtmtOya 11 | dDQgQT9jYiDrGLI4HwBwED/Bf/1NmAks23NJju8lIA2T7eXNrKMdvclAoDi3cCNN 12 | nGojzg2IiopQJ1NWZ2Jc+0alNRVc2J8/nAnUor3ci08Hw63j5WMLWMaDhj1HNUCy 13 | Z9ZoDhbe6lUbNk1REqKK0MwtiHYVpyzEiAwYaK16wQKBgQD50um41JUlAfRAO8jD 14 | yLf5fi2OlH3Wtm8hh23nijrsMM+PGqsJ2plkLGi/XLBj8QGwPbCfBKjXMmOIoo6z 15 | 7nRg01XTHNA8cXLjPzyYiQAJeJhQJOdlANKQZOVX9oqz6x/Lqn4X8yGMbcpJnekM 16 | wz4qWCbvdfMr/gHjMM5IXSkBEwKBgQDB8B+uZPEBk3E4foLa/KuPLh96Kc0uT/qh 17 | aY82d2ul8hS0oWy6yyUxaRSKnqX5FhwjJ65JHDWwyBVOgg5Fep1mVEaz1v2ZPYGh 18 | 6pmflQ31MW+T4H5YwPgR4cyOssBiBa33mgjyKoAWrvxAFBCeOsbQ3B/sEw9FsJ1u 19 | c2JydhgTewKBgFefHA6RsQXb25kz3sScf7poAP6DImfOcMfnwip1lxkEPahJiDfa 20 | jfZOhSapEczb2OXBnVMIxVdE+xgPO9HsDrFvLijvcDHi8JK3uT8evf6UZ4ekiewp 21 | D7FJUg86D4fvLaW3VKZ9xgSE9XBAjF7Hk+QyKuXODs4dNvhCQ/ephRo1AoGACv8W 22 | jMjkcXZuwQlLWidhgujWmBKus6WNTIGzwR7cV7h2PBe7FoxWO4r9wy5jss/yIHwr 23 | gbG7yZ5Otvjg3kepjRfSOnhCQOIf65Jly4qkE/cNoJDmGRo39qua8axpBCXWS2fM 24 | gg6u3Jpnayq4FoC2rTkOBlC+WPE+u/iG6H6RtukCgYEAtBd5iX1wjiSAY/N2eWHM 25 | TcNmwSvQRWFd5IG52cNpir2wBa+2PI9F74CjwvGGEZ+/DMJUhjTFQG57APU7MjHl 26 | vJv9vHF7R9Y7tiFk1anEbb1apE8zVywiXSOwMTJWspbnSiJE35NJVdW8mVBNDsfj 27 | FKD1HkvvGcjbB5wLfjuCles= 28 | -----END PRIVATE KEY----- 29 | -------------------------------------------------------------------------------- /virtuoso/fp3_vos_setup.template.sql: -------------------------------------------------------------------------------- 1 | -- Assumes virtuoso.ini contains: 2 | -- DefaultHost = fp3.myhost.com:8181 3 | 4 | DB.DBA.USER_CREATE ('SPARQL_ADMIN', uuid()); 5 | DB.DBA.EXEC_STMT ('grant SPARQL_UPDATE to SPARQL_ADMIN', 0); 6 | DB.DBA.RDF_DEFAULT_USER_PERMS_SET ('SPARQL_ADMIN', 15, 0); 7 | DB.DBA.RDF_DEFAULT_USER_PERMS_SET ('SPARQL_ADMIN', 15, 1); 8 | 9 | -- 10 | -- Set up LDP root folder for FP3 Platform 11 | -- 12 | XML_SET_NS_DECL ('ldp','http://www.w3.org/ns/ldp#',2); 13 | DB.DBA.DAV_COL_CREATE ('/DAV/home/fusepool/', '111111111R', 'dav','administrators', 'dav', 'dav'); 14 | DB.DBA.DAV_COL_CREATE ('/DAV/home/fusepool/ldp/', '111111111R', 'dav','administrators', 'dav', 'dav'); 15 | DB.DBA.DAV_PROP_SET ('/DAV/home/fusepool/ldp/', 'LDP', 'ldp:BasicContainer', 'dav','dav', 1); 16 | TTLP ('@prefix ldp: . 17 | <> a ldp:BasicContainer .', 'http://fp3.myhost.com:8181/DAV/home/fusepool/ldp/', 'http://fp3.myhost.com:8181/DAV/home/fusepool/ldp/'); 18 | 19 | DB.DBA.VHOST_REMOVE ( 20 | lhost=>'*ini*', 21 | vhost=>'*ini*', 22 | lpath=>'/DAV/home/fusepool/ldp'); 23 | 24 | DB.DBA.VHOST_DEFINE ( 25 | lhost=>'*ini*', 26 | vhost=>'*ini*', 27 | lpath=>'/DAV/home/fusepool/ldp', 28 | ppath=>'/DAV/home/fusepool/ldp/', 29 | is_dav=>1, 30 | def_page=>'', 31 | is_brws=>1, 32 | vsp_user=>'dba', 33 | ses_vars=>0, 34 | opts=>vector ('browse_sheet', '', 'cors', '*'), 35 | is_default_host=>0 36 | ); 37 | 38 | -- 39 | -- Enable CORs on /sparql endpoint 40 | -- 41 | create procedure DB.DBA.SPARQL_VHOST_CORS_ENABLE() 42 | { 43 | declare opts any; 44 | opts := (select deserialize(HP_OPTIONS) from DB.DBA.HTTP_PATH where HP_LPATH = '/sparql'); 45 | opts := vector_concat (opts, vector ('cors', '*')); 46 | update DB.DBA.HTTP_PATH set HP_OPTIONS = serialize(opts) where HP_LPATH = '/sparql'; 47 | } 48 | ; 49 | 50 | DB.DBA.SPARQL_VHOST_CORS_ENABLE(); 51 | 52 | DROP PROCEDURE DB.DBA.SPARQL_VHOST_CORS_ENABLE; 53 | 54 | commit work; 55 | -------------------------------------------------------------------------------- /docker-compose-commons.yml: -------------------------------------------------------------------------------- 1 | logdata: 2 | image: busybox 3 | volumes: 4 | - /var/log 5 | entrypoint: /bin/true 6 | 7 | entry: 8 | image: fusepoolp3/entry-resource 9 | ports: 10 | - "80:8080" 11 | volumes: 12 | - ./boot-scripts/09-init-stanbol.js:/etc/fusepool-p3/boot-scripts/09-init-stanbol.js 13 | - ./boot-scripts/10-init-pundit.js:/etc/fusepool-p3/boot-scripts/10-init-pundit.js 14 | restart: unless-stopped 15 | 16 | 17 | core: 18 | image: fusepoolp3/various-services 19 | ports: 20 | - "8181:8181" 21 | - "8151:8151" 22 | - "8200:8200" 23 | - "8201:8201" 24 | - "8202:8202" 25 | - "8203:8203" 26 | - "8204:8204" 27 | - "8205:8205" 28 | - "8206:8206" 29 | - "8207:8207" 30 | - "8300:8300" 31 | - "8301:8301" 32 | - "8302:8302" 33 | - "8303:8303" 34 | - "8305:8305" 35 | - "8306:8306" 36 | - "8307:8307" 37 | - "8309:8309" 38 | - "8308:8308" 39 | - "8388:8388" 40 | volumes: 41 | - ./core/ELK/logstash-config/patterns:/etc/logstash-config/patterns/ 42 | - ./core/ELK/logstash-ssl:/etc/ssl/ 43 | - ./core/ELK/logstash-forwarder.conf:/etc/logstash-forwarder.conf 44 | restart: unless-stopped 45 | 46 | stanbol: 47 | image: fusepoolp3/stanbol-launcher 48 | ports: 49 | - "8304:8080" 50 | restart: unless-stopped 51 | 52 | 53 | batchrefine: 54 | image: fusepool/p3-batchrefine 55 | ports: 56 | - "8310:8310" 57 | restart: unless-stopped 58 | 59 | openrefine: 60 | image: fusepool/openrefine 61 | ports: 62 | - "8389:3333" 63 | restart: unless-stopped 64 | 65 | 66 | elk: 67 | image: willdurand/elk 68 | ports: 69 | - "9200:9200" 70 | - "8387:80" 71 | - "127.0.0.1:5043:5043" 72 | volumes: 73 | - ./core/ELK/logstash-ssl:/etc/ssl 74 | - ./core/ELK/logstash-config:/etc/logstash 75 | restart: unless-stopped 76 | 77 | 78 | pundittransformer: 79 | image: danilogiacomi/pundittransformer 80 | ports: 81 | - "8386:80" 82 | restart: unless-stopped 83 | 84 | -------------------------------------------------------------------------------- /virtuoso/README.md: -------------------------------------------------------------------------------- 1 | #Virtuoso Database Initialization for the FP3 Platform 2 | 3 | When using Virtuoso as an LDP backend for the the FP3 Platform, the Virtuoso database must be preconfigured before the platform itself is initialized. 4 | 5 | The database and LDP root folder must both be created, and CORS enabled on the LDP root and /sparql endpoint. It is not possible to do this as part of the platform initialization. 6 | 7 | These notes detail the required preconfiguration steps. 8 | 9 | ## Preconfiguration 10 | Pull the VOS (Virtuoso Open Source Edition) Docker image from the Docker registry. 11 | 12 | * `docker pull openlink/virtuoso_opensource:vos` 13 | 14 | The image is configured to host the database in the host file system. The database location on the host should reflect the installation directory assumed by the image. 15 | 16 | Create directory /opt/virtuoso-opensource/var/lib/virtuoso/db in the host file system and copy in the provided template configuration file virtuoso.fp3_template.ini. 17 | 18 | * `sudo mkdir -p /opt/virtuoso-opensource/var/lib/virtuoso/db` 19 | * `sudo cp ./virtuoso.fp3_template.ini /opt/virtuoso-opensource/var/lib/virtuoso/db/virtuoso.ini` 20 | * `sudo chmod a+w /opt/virtuoso-opensource/var/lib/virtuoso/db` 21 | 22 | Edit the virtuoso.ini file, setting the DefaultHost hostname appropriately, similar to the example extract below. The DefaultHost port must be 8181. This is required to ensure that null relative LDP URIs, when expanded, use the FP3 Transforming Proxy as the authority, rather than the LDP server host. 23 | 24 | [URIQA] 25 | DynamicLocal = 0 26 | ;DefaultHost = fp3.myhost.com:8890 27 | ; DefaultHost must match the FP3 Proxy host/port 28 | ; so null relative LDP URIs when expanded are rooted 29 | ; to the proxy not the LDP server host. 30 | DefaultHost = fp3.myhost.com:8181` 31 | 32 | Launch the VOS Docker image 33 | 34 | * `docker run --name vos -d -v /opt/virtuoso-opensource/var/lib/virtuoso/db:/opt/virtuoso-opensource/var/lib/virtuoso/db -p 1111:1111 -p 8890:8890 openlink/virtuoso_opensource:vos` 35 | 36 | VOS will create a new database when started for the first time. 37 | 38 | A Virtuoso/PL script is needed to create the LDP root directory and enable CORS: 39 | 40 | * Edit p3_vos_setup.template.sql, replacing fp3.myhost.com with the correct hostname. 41 | * Login to Virtuoso's Conductor UI via http://fp3.myhost.com:8890 (Default username and password: 'dba', 'dba') then paste in and execute the above script in Conductor's isql console. 42 | 43 | Shutdown and remove the VOS container: 44 | 45 | * `docker kill vos` 46 | * `docker rm vos` 47 | 48 | The required one-time initialization of Virtuoso for FP3 should now be complete, ready for launching the FP3 Platform. 49 | 50 | -------------------------------------------------------------------------------- /virtuoso/boot-scripts/03-virtuoso-backend.js: -------------------------------------------------------------------------------- 1 | /* global P3BackendConfigurator */ 2 | 3 | (function() { 4 | var host = window.location.hostname; 5 | P3BackendConfigurator.prototype.serviceHost = host; 6 | 7 | P3BackendConfigurator.prototype.getLdpRoot = function() { 8 | return new Promise(function(resolve, reject) { 9 | resolve("http://"+host+":8181/DAV/home/fusepool/ldp/"); 10 | }); 11 | }; 12 | 13 | P3BackendConfigurator.prototype.registerBackendfeatures = function(ldpRoot) { 14 | var registrations = []; 15 | registrations.push(this.platformEntryConfigurator.registerSparql("http://"+this.serviceHost+":8181/sparql")); 16 | registrations.push(this.platformEntryConfigurator.registerLdpRoot(ldpRoot)); 17 | return Promise.all(registrations); 18 | }; 19 | 20 | P3BackendConfigurator.prototype.registerRegistries = function(ldpRoot) { 21 | var ldpBaseURI = ldpRoot.endsWith('/') ? ldpRoot : ldpRoot+'/'; 22 | var self = this; 23 | var irldpcUri = ldpBaseURI + 'uir/'; 24 | var putIrldpcRequest = $.ajax({type: 'PUT', 25 | url: irldpcUri, 26 | headers: {'Content-Type': 'text/turtle', 'Link': "; rel='type'"}, 27 | data: '<> a ; ' + 28 | ' "Interaction Request Container"@en ; ' + 29 | ' "Contains Interaction Requests"@en . ', 30 | async: true 31 | }); 32 | 33 | var ldpDependetRegistrations = []; 34 | ldpDependetRegistrations.push(putIrldpcRequest.then(function () { 35 | return self.platformEntryConfigurator.registerIRLDPC(irldpcUri); 36 | })); 37 | 38 | var tfrUri = ldpBaseURI + 'tfr/'; 39 | var putTfrRequest = $.ajax({type: 'PUT', 40 | url: tfrUri, 41 | headers: {'Content-Type': 'text/turtle', 'Link': "; rel='type'"}, 42 | data: '<> a ; ' + 43 | ' "Transformer Factory Registry"@en ; ' + 44 | ' "Contains Transformer Factories"@en . ', 45 | async: true 46 | }); 47 | 48 | ldpDependetRegistrations.push(putTfrRequest.then(function () { 49 | return self.platformEntryConfigurator.registerTFR(tfrUri); 50 | })); 51 | 52 | var trUri = ldpBaseURI + 'tr/'; 53 | var putTrRequest = $.ajax({type: 'PUT', 54 | url: trUri, 55 | headers: {'Content-Type': 'text/turtle', 'Link': "; rel='type'"}, 56 | data: '<> a ; ' + 57 | ' "Transformer Registry"@en ; ' + 58 | ' "Contains Transformers"@en . ', 59 | async: true 60 | }); 61 | 62 | ldpDependetRegistrations.push(putTrRequest.then(function () { 63 | return self.platformEntryConfigurator.registerTR(trUri); 64 | })); 65 | 66 | var dcrUri = ldpBaseURI + 'dcr/'; 67 | var putDcrRequest = $.ajax({type: 'PUT', 68 | url: dcrUri, 69 | headers: {'Content-Type': 'text/turtle', 'Link': "; rel='type'"}, 70 | data: '<> a ; ' + 71 | ' "Dashboard Config Registry"@en ; ' + 72 | ' "Contains dashboard configurations"@en . ', 73 | async: true 74 | }); 75 | 76 | ldpDependetRegistrations.push(putDcrRequest.then(function () { 77 | return self.platformEntryConfigurator.registerDCR(dcrUri); 78 | })); 79 | 80 | return Promise.all(ldpDependetRegistrations).catch( function(error) { 81 | if (error.status === 428) { 82 | // we assume the precondition failed because it's alrteady there and do nothing 83 | } else { 84 | throw error; 85 | } 86 | }); 87 | }; 88 | 89 | })(); 90 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Fusepool P3 Platform Reference Implementation 2 | 3 | 4 | ## Prerequisites 5 | 6 | this project requires `docker compose`. See the installation instructions here: https://docs.docker.com/compose/install/ 7 | 8 | ## Running the docker compose 9 | 10 | Change into the directory corresponsing to the backend you woul like to use, e.g: 11 | 12 | cd marmotta 13 | 14 | From there run: 15 | 16 | docker-compose up 17 | 18 | See the [Compose CLI reference](https://docs.docker.com/compose/reference/) for how to mange the containers started with docker-compose. 19 | 20 | ## Using 21 | 22 | When the container has finished starting, you can access the Fusepool P3 23 | platform directly on the host running the container. With a web browser 24 | access http://\/. Important: The P3 Platform will autoconfigure itself 25 | with the hostname that it used to first access it, so if you intend the platform 26 | to be accessible on http://example.com/ the first access must done using this URI 27 | and *not* with http://localhost/, of course if you just want to try things out 28 | locally using /localhost/ is just fine. 29 | 30 | The different components of Fusepool P3 31 | can be accessed over the ports exposed by the container. Curently, these are: 32 | 33 | * 8181 - Fusepool's LDP over [p3-proxy](https://github.com/fusepoolP3/p3-proxy) 34 | * 8151 - [p3-transformer-web-client](https://github.com/fusepoolP3/p3-transformer-web-client) 35 | * 8200 - [p3-dashboard](https://github.com/fusepoolP3/p3-dashboard) 36 | * 8201 - [p3-pipeline-gui-js](https://github.com/fusepoolP3/p3-pipeline-gui-js) 37 | * 8202 - [p3-dictionary-matcher-factory-gui](https://github.com/fusepoolP3/p3-dictionary-matcher-factory-gui) 38 | * 8203 - [p3-batchrefine-factory-gui](https://github.com/fusepoolP3/p3-batchrefine-factory-gui) 39 | * 8204 - [p3-xslt-factory-gui](https://github.com/fusepoolP3/p3-xslt-factory-gui) 40 | * 8205 - [p3-resource-gui](https://github.com/fusepoolP3/p3-resource-gui) 41 | * 8300 - [p3-pipeline-transformer](https://github.com/fusepoolP3/p3-pipeline-transformer) 42 | * 8301 - [p3-dictionary-matcher-transformer](https://github.com/fusepoolP3/p3-dictionary-matcher-transformer) 43 | * 8302 - [p3-geo-enriching-transformer](https://github.com/fusepoolP3/p3-geo-enriching-transformer) 44 | * 8303 - [p3-any23-transformer](https://github.com/fusepoolP3/p3-any23-transformer) 45 | * 8305 - [p3-literal-extraction-transformer](https://github.com/fusepoolP3/p3-literal-extraction-transformer) 46 | * 8306 - [p3-silkdedup](https://github.com/fusepoolP3/p3-silkdedup) 47 | * 8307 - [p3-xslt-transformer](https://github.com/fusepoolP3/p3-xslt-transformer) 48 | * 8308 - [p3-geocoordinates-transformer](https://github.com/fusepoolP3/p3-geocoordinates-transformer) 49 | * 8310 - [p3-batchrefine](https://github.com/fusepoolP3/p3-batchrefine) 50 | * 8386 - [p3-pundit-transformer](https://github.com/fusepoolP3/punditTransformer) 51 | * 8387 - [Elasticsearch-Logstash-Kibana](https://www.elastic.co/products/logstash) 52 | * 8388 - Real-time log monitoring with [Log.io](https://github.com/NarrativeScience/Log.io) 53 | 54 | ## Using Marmotta with PostgreSQL 55 | 56 | By default Apache Marmotta is using an in-memory store. This is fine for testing but it should not be used in production. Instead it is recommended to use the [PostgreSQL backend](http://marmotta.apache.org/configuration.html) from Marmotta. 57 | 58 | To enable PostgreSQL uncomment the according lines in `marmotta/docker-compose.yml` and run `docker-compose up`. Marmotta will now have access to a host called `postgres` and you can adjust the Marmotta configuration accordingly. For this go to `http://:8181/storage-kiwi/admin/database.html` and adjust the following parameters: 59 | 60 | * Database: `postgres` 61 | * Host: `jdbc:postgresql://postgres:5432/postgres?prepareThreshold=3` 62 | * User: `postgres` 63 | * Password: `yourPostgresPassword` 64 | 65 | You can change the password by adjusting the environment variable `POSTGRES_PASSWORD` in `marmotta/docker-compose.yml`. 66 | 67 | Once the connection is saved you can initialize the platform. Note that in case you want to use PostgreSQL you cannot do that before, it will not work! PostgreSQL is storing the data in the postgres docker container. Consult the [homepage](https://hub.docker.com/_/postgres/) to learn about how to customize this. 68 | 69 | Note that the admin interface of Marmotta is public by default; you most probably want to lock that down in production. 70 | -------------------------------------------------------------------------------- /virtuoso/virtuoso.fp3_template.ini: -------------------------------------------------------------------------------- 1 | ; 2 | ; virtuoso.ini 3 | ; 4 | ; Configuration file for the OpenLink Virtuoso VDBMS Server 5 | ; 6 | ; To learn more about this product, or any other product in our 7 | ; portfolio, please check out our web site at: 8 | ; 9 | ; http://virtuoso.openlinksw.com/ 10 | ; 11 | ; or contact us at: 12 | ; 13 | ; general.information@openlinksw.com 14 | ; 15 | ; If you have any technical questions, please contact our support 16 | ; staff at: 17 | ; 18 | ; technical.support@openlinksw.com 19 | ; 20 | ; 21 | ; Database setup 22 | ; 23 | [Database] 24 | DatabaseFile = /opt/virtuoso-opensource/var/lib/virtuoso/db/virtuoso.db 25 | ErrorLogFile = /opt/virtuoso-opensource/var/lib/virtuoso/db/virtuoso.log 26 | LockFile = /opt/virtuoso-opensource/var/lib/virtuoso/db/virtuoso.lck 27 | TransactionFile = /opt/virtuoso-opensource/var/lib/virtuoso/db/virtuoso.trx 28 | xa_persistent_file = /opt/virtuoso-opensource/var/lib/virtuoso/db/virtuoso.pxa 29 | ErrorLogLevel = 7 30 | FileExtend = 200 31 | MaxCheckpointRemap = 2000 32 | Striping = 0 33 | TempStorage = TempDatabase 34 | 35 | [TempDatabase] 36 | DatabaseFile = /opt/virtuoso-opensource/var/lib/virtuoso/db/virtuoso-temp.db 37 | TransactionFile = /opt/virtuoso-opensource/var/lib/virtuoso/db/virtuoso-temp.trx 38 | MaxCheckpointRemap = 2000 39 | Striping = 0 40 | 41 | ; 42 | ; Server parameters 43 | ; 44 | [Parameters] 45 | ServerPort = 1111 46 | LiteMode = 0 47 | DisableUnixSocket = 1 48 | DisableTcpSocket = 0 49 | ;SSLServerPort = 2111 50 | ;SSLCertificate = cert.pem 51 | ;SSLPrivateKey = pk.pem 52 | ;X509ClientVerify = 0 53 | ;X509ClientVerifyDepth = 0 54 | ;X509ClientVerifyCAFile = ca.pem 55 | MaxClientConnections = 10 56 | CheckpointInterval = 60 57 | O_DIRECT = 0 58 | CaseMode = 2 59 | MaxStaticCursorRows = 5000 60 | CheckpointAuditTrail = 0 61 | AllowOSCalls = 0 62 | SchedulerInterval = 10 63 | DirsAllowed = ., /opt/virtuoso-opensource/share/virtuoso/vad 64 | ThreadCleanupInterval = 0 65 | ThreadThreshold = 10 66 | ResourcesCleanupInterval = 0 67 | FreeTextBatchSize = 100000 68 | SingleCPU = 0 69 | VADInstallDir = /opt/virtuoso-opensource/share/virtuoso/vad/ 70 | PrefixResultNames = 0 71 | RdfFreeTextRulesSize = 100 72 | IndexTreeMaps = 256 73 | MaxMemPoolSize = 200000000 74 | PrefixResultNames = 0 75 | MacSpotlight = 0 76 | IndexTreeMaps = 64 77 | MaxQueryMem = 2G ; memory allocated to query processor 78 | VectorSize = 1000 ; initial parallel query vector (array of query operations) size 79 | MaxVectorSize = 1000000 ; query vector size threshold. 80 | AdjustVectorSize = 0 81 | ThreadsPerQuery = 4 82 | AsyncQueueMaxThreads = 10 83 | ;; 84 | ;; When running with large data sets, one should configure the Virtuoso 85 | ;; process to use between 2/3 to 3/5 of free system memory and to stripe 86 | ;; storage on all available disks. 87 | ;; 88 | ;; Uncomment next two lines if there is 2 GB system memory free 89 | ;NumberOfBuffers = 170000 90 | ;MaxDirtyBuffers = 130000 91 | ;; Uncomment next two lines if there is 4 GB system memory free 92 | ;NumberOfBuffers = 340000 93 | ; MaxDirtyBuffers = 250000 94 | ;; Uncomment next two lines if there is 8 GB system memory free 95 | ;NumberOfBuffers = 680000 96 | ;MaxDirtyBuffers = 500000 97 | ;; Uncomment next two lines if there is 16 GB system memory free 98 | ;NumberOfBuffers = 1360000 99 | ;MaxDirtyBuffers = 1000000 100 | ;; Uncomment next two lines if there is 32 GB system memory free 101 | ;NumberOfBuffers = 2720000 102 | ;MaxDirtyBuffers = 2000000 103 | ;; Uncomment next two lines if there is 48 GB system memory free 104 | ;NumberOfBuffers = 4000000 105 | ;MaxDirtyBuffers = 3000000 106 | ;; Uncomment next two lines if there is 64 GB system memory free 107 | ;NumberOfBuffers = 5450000 108 | ;MaxDirtyBuffers = 4000000 109 | ;; 110 | ;; Note the default settings will take very little memory 111 | ;; but will not result in very good performance 112 | ;; 113 | NumberOfBuffers = 10000 114 | MaxDirtyBuffers = 6000 115 | 116 | [HTTPServer] 117 | ServerPort = 8890 118 | ServerRoot = /opt/virtuoso-opensource/var/lib/virtuoso/vsp 119 | MaxClientConnections = 10 120 | DavRoot = DAV 121 | EnabledDavVSP = 0 122 | HTTPProxyEnabled = 0 123 | TempASPXDir = 0 124 | DefaultMailServer = localhost:25 125 | ServerThreads = 10 126 | MaxKeepAlives = 10 127 | KeepAliveTimeout = 10 128 | MaxCachedProxyConnections = 10 129 | ProxyConnectionCacheTimeout = 15 130 | HTTPThreadSize = 280000 131 | HttpPrintWarningsInOutput = 0 132 | Charset = UTF-8 133 | ;HTTPLogFile = logs/http29092015.log 134 | ;EnableRequestTrap = 1 135 | MaintenancePage = atomic.html 136 | EnabledGzipContent = 1 137 | 138 | [AutoRepair] 139 | BadParentLinks = 0 140 | 141 | [Client] 142 | SQL_PREFETCH_ROWS = 100 143 | SQL_PREFETCH_BYTES = 16000 144 | SQL_QUERY_TIMEOUT = 0 145 | SQL_TXN_TIMEOUT = 0 146 | ;SQL_NO_CHAR_C_ESCAPE = 1 147 | ;SQL_UTF8_EXECS = 0 148 | ;SQL_NO_SYSTEM_TABLES = 0 149 | ;SQL_BINARY_TIMESTAMP = 1 150 | ;SQL_ENCRYPTION_ON_PASSWORD = -1 151 | 152 | [VDB] 153 | ArrayOptimization = 0 154 | NumArrayParameters = 10 155 | VDBDisconnectTimeout = 1000 156 | KeepConnectionOnFixedThread = 0 157 | 158 | [Replication] 159 | ServerName = db-INSPIRO 160 | ServerEnable = 1 161 | QueueMax = 50000 162 | 163 | ; 164 | ; Striping setup 165 | ; 166 | ; These parameters have only effect when Striping is set to 1 in the 167 | ; [Database] section, in which case the DatabaseFile parameter is ignored. 168 | ; 169 | ; With striping, the database is spawned across multiple segments 170 | ; where each segment can have multiple stripes. 171 | ; 172 | ; Format of the lines below: 173 | ; Segment = , [, .. ] 174 | ; 175 | ; must be ordered from 1 up. 176 | ; 177 | ; The is the total size of the segment which is equally divided 178 | ; across all stripes forming the segment. Its specification can be in 179 | ; gigabytes (g), megabytes (m), kilobytes (k) or in database blocks 180 | ; (b, the default) 181 | ; 182 | ; Note that the segment size must be a multiple of the database page size 183 | ; which is currently 8k. Also, the segment size must be divisible by the 184 | ; number of stripe files forming the segment. 185 | ; 186 | ; The example below creates a 200 meg database striped on two segments 187 | ; with two stripes of 50 meg and one of 100 meg. 188 | ; 189 | ; You can always add more segments to the configuration, but once 190 | ; added, do not change the setup. 191 | ; 192 | [Striping] 193 | Segment1 = 100M, db-seg1-1.db, db-seg1-2.db 194 | Segment2 = 100M, db-seg2-1.db 195 | ;... 196 | ;[TempStriping] 197 | ;Segment1 = 100M, db-seg1-1.db, db-seg1-2.db 198 | ;Segment2 = 100M, db-seg2-1.db 199 | ;... 200 | ;[Ucms] 201 | ;UcmPath = 202 | ;Ucm1 = 203 | ;Ucm2 = 204 | ;... 205 | 206 | [Zero Config] 207 | ServerName = virtuoso (MYHOST) 208 | ;ServerDSN = ZDSN 209 | ;SSLServerName = 210 | ;SSLServerDSN = 211 | 212 | [Mono] 213 | ;MONO_TRACE = Off 214 | ;MONO_PATH = 215 | ;MONO_ROOT = 216 | ;MONO_CFG_DIR = 217 | ;virtclr.dll = 218 | 219 | [URIQA] 220 | DynamicLocal = 0 221 | ;DefaultHost = fp3.myhost.com:8890 222 | ;DefaultHost must match the FP3 Proxy host/port so null relative LDP URIs when expanded are rooted to the proxy not the LDP server host. 223 | DefaultHost = fp3.myhost.com:8181 224 | 225 | [SPARQL] 226 | ;ExternalQuerySource = 1 227 | ;ExternalXsltSource = 1 228 | ;DefaultGraph = http://localhost:8890/dataspace 229 | ;ImmutableGraphs = http://localhost:8890/dataspace 230 | ResultSetMaxRows = 10000 231 | MaxQueryCostEstimationTime = 400 ; in seconds 232 | MaxQueryExecutionTime = 60 ; in seconds 233 | DefaultQuery = select distinct ?Concept where {[] a ?Concept} LIMIT 100 234 | DeferInferenceRulesInit = 0 ; controls inference rules loading 235 | ;PingService = http://rpc.pingthesemanticweb.com/ 236 | 237 | [Plugins] 238 | LoadPath = /opt/virtuoso-opensource/lib/virtuoso/hosting 239 | ;Load1 = plain, wikiv 240 | ;Load2 = plain, mediawiki 241 | ;Load3 = plain, creolewiki 242 | ;Load4 = plain, im 243 | ;Load5 = plain, wbxml2 244 | ;Load6 = plain, hslookup 245 | ;Load7 = attach, libphp5.so 246 | ;Load8 = Hosting, hosting_php.so 247 | ;Load9 = Hosting,hosting_perl.so 248 | ;Load10 = Hosting,hosting_python.so 249 | ;Load11 = Hosting,hosting_ruby.so 250 | ;Load12 = msdtc,msdtc_sample 251 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | --------------------------------------------------------------------------------