Thursday, May 25, 2017

Steps taken to get the Docker Web of Needs Swarm Running

**Actually, it does not seem to be a swam. it is running on one machine, but docker-compose is being used.

Beginning with https://github.com/researchstudio-sat/webofneeds/tree/master/webofneeds/won-docker I followed the steps:

(1) Install docker
Start with https://docs.docker.com/get-started/

(2) Install docker-compose
https://docs.docker.com/compose/overview/
and follow the tutorial
https://docs.docker.com/compose/gettingstarted/

(3) Create base_folder (mkdir data), .env file (see below), and docker-compose file (wget https://raw.githubusercontent.com/researchstudio-sat/webofneeds/master/webofneeds/won-docker/deploy/local/docker-compose.yml)

~/Documents/dockerexperiments/webofneeds$ ls -a
.  ..  data  docker-compose.yml  .env

~/Documents/dockerexperiments/webofneeds$ cat .env

deploy_host=localhost
base_folder=./data/



(4) Run docker compose in the same directory without the detached option to enable debugging:
sudo docker-compose up (also "sudo service tomcat7 stop" and "sudo service mongodb stop" to prevent port conflicts)

(5) There is an error when trying to create a resource over https on localhost. Here are some instructions that may help set it up:
https://docs.docker.com/engine/security/https/

(6) Investigate the server cert:
~/Documents/dockerexperiments/webofneeds/data/won-server-certs$ openssl x509 -noout -text -in t-cert.pem
Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number: 9744456803442286009 (0x873b43d59a50ddb9)
    Signature Algorithm: sha256WithRSAEncryption
        Issuer: CN=localhost
        Validity
            Not Before: May 25 00:12:13 2017 GMT
            Not After : May 25 00:12:14 2018 GMT
        Subject: CN=localhost
        Subject Public Key Info:
            Public Key Algorithm: rsaEncryption
                Public-Key: (2048 bit)
                Modulus:
                    00:f5:a7:56:1a:c6:91:dc:3e:ed:82:ec:bc:73:87:
                    89:34:fc:e7:63:d8:e3:b6:21:0b:76:db:44:f8:6d:
                    5c:e7:e1:64:2b:48:76:a1:2e:b2:fe:28:dd:8b:3f:
                    8c:4c:1d:42:ca:bf:92:c0:90:fe:05:a6:db:2a:d6:
                    17:86:dd:5d:76:a0:86:7f:c2:ec:32:85:0a:91:d3:
                    7d:52:bf:43:bf:c1:84:8b:e0:30:e6:08:39:1c:c2:
                    63:3c:49:c2:11:8b:2e:b9:f9:39:78:40:59:4c:a2:
                    d7:b5:f4:c8:5b:68:72:72:51:f1:2d:8f:e7:0d:f5:
                    de:f7:38:42:4a:13:b0:23:c4:58:61:bc:1a:c0:b0:
                    09:38:4b:aa:06:76:b2:67:24:80:b2:71:81:bd:5e:
                    55:e4:6c:86:14:62:71:e5:e0:c8:97:f2:59:17:41:
                    b1:78:44:49:8c:28:bb:ab:9c:72:e1:7b:ec:7c:9b:
                    b5:31:da:66:18:8e:9e:61:89:a8:29:79:84:89:a2:
                    4f:dc:c0:39:4e:a8:e3:35:e1:0e:b8:2f:26:c8:2a:
                    7a:ad:11:23:25:5b:39:cc:81:bd:4b:66:b7:aa:31:
                    1c:69:79:6f:e6:03:fe:c0:eb:c9:98:6a:a6:32:3c:
                    b8:3e:c3:2b:f4:6b:34:66:6c:ae:ba:8f:b0:ef:23:
                    c0:b1
                Exponent: 65537 (0x10001)
        X509v3 extensions:
            X509v3 Subject Key Identifier:
                36:B7:33:A7:6D:AC:CE:1C:99:51:84:20:64:F4:A2:62:98:97:32:71
            X509v3 Authority Key Identifier:
                keyid:36:B7:33:A7:6D:AC:CE:1C:99:51:84:20:64:F4:A2:62:98:97:32:71

            X509v3 Basic Constraints:
                CA:TRUE
    Signature Algorithm: sha256WithRSAEncryption
         be:73:e7:58:dd:78:38:36:56:14:90:bf:da:f1:ca:1f:1e:32:
         bf:92:8f:e7:ee:16:48:38:13:83:8d:ce:d2:ec:fd:45:9b:31:
         eb:b2:07:d0:b6:bf:5c:78:32:89:a2:e1:0c:18:ce:d0:19:ee:
         ae:75:85:6f:da:a5:81:d6:f2:aa:01:b1:65:33:ce:9d:ec:99:
         9f:3a:69:3f:66:68:c1:39:27:5f:23:ae:26:9b:60:d7:ef:48:
         74:41:b0:d2:0c:c9:fc:2c:7a:70:35:75:70:6f:71:64:72:78:
         d9:b1:b9:fb:f3:4e:45:a0:5c:83:b0:c4:35:25:7a:41:b3:4a:
         21:34:67:2d:af:28:1f:66:64:42:ab:e5:46:30:4a:6f:8e:d9:
         5a:62:bf:04:d5:fb:e7:3a:ca:86:60:35:9e:93:b3:94:89:81:
         d0:6a:5f:c9:80:27:c2:b2:88:54:a8:61:c9:b6:47:07:c0:3b:
         91:26:8e:7f:c7:62:44:48:a9:5b:30:96:27:22:1f:9c:ad:dd:
         30:42:b2:a7:71:39:2b:30:85:7b:0f:f4:8a:36:1a:ec:75:96:
         6e:53:c4:2e:f5:28:2c:57:de:e8:56:82:84:99:e1:1b:f0:d3:
         1d:6b:37:d6:53:da:e6:74:00:bb:69:f8:64:ba:83:b8:5e:49:
         7f:91:f4:60

========================
 other interesting things
======================================

Interesting part of the log:
owner_1            | 25-May-2017 19:35:01.759 INFO [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.

Interesting part of the log:
java.util.concurrent.TimeoutException

Interesting part of the log:
Connection refused:

Interesting part of the log:
blue hard drive light on...perhaps the RAM is low and SWAP space is being used, perhaps there are memory leaks

Fix the certificate due to https://localhost:8890 unable to create resource errors?:

/home/brent/Documents/dockerexperiments/webofneeds/data/won-server-certs# cp *.pem /home/brent/.docker/

(will this really work? The "Protect the Docker daemon socket" has a secure by default section that says to set the DOCKER_HOST and DOCKER_TLS_VERIFY variables (setting DOCKER_TLS_VERIFY=1 in the .env file causes an error))

Friday, May 19, 2017

PowerAqua test May 19th

<?xml version="1.0" encoding="UTF-8"?>
<CONFIGURATION>
        <WATSON>false</WATSON>
        <POWERMAP>false</POWERMAP>
        <VIRTUOSO>false</VIRTUOSO>
        <REMOTESPARQLVIRTUOSO>false</REMOTESPARQLVIRTUOSO>
<ONTOLOGY_INDEX_DB>jdbc:mysql://127.0.0.1:3306/ontologyindexrelation</ONTOLOGY_INDEX_DB>
<ONTOLOGY_INDEX_DB_LOGIN>root</ONTOLOGY_INDEX_DB_LOGIN>
<ONTOLOGY_INDEX_DB_PASSWORD>password</ONTOLOGY_INDEX_DB_PASSWORD>
<INDEX_GLOBAL_PATH>./LuceneIndexes/</INDEX_GLOBAL_PATH>
<INDEX_INFO_FOLDER>./indexListInformation/indexbrentweb/</INDEX_INFO_FOLDER>


running: http://localhost:8080/poweraqua gives :

no error...


Clicking the ask button (with a string in the blank) gives:





java.lang.NullPointerException
 poweraqua.LinguisticComponent.GateChunker.ExecuteSerialController(GateChunker.java:322)
 poweraqua.LinguisticComponent.GateChunker.ParseQuestion(GateChunker.java:445)
 poweraqua.LinguisticComponent.LinguisticComponent.parseQuestion(LinguisticComponent.java:114)
 org.apache.jsp.jsp.answer_jsp._jspService(answer_jsp.java:167)
 org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
 org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
 org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
 org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:727)

Monday, May 15, 2017

Change Log for PowerAqua (may 15th)

In /var/lib/tomcat7/webapps/poweraqua, change service_properties.xml from:

<?xml version="1.0" encoding="UTF-8"?><CONFIGURATION><PLUGIN_MANAGER>/var/lib/tomcat7/webapps/poweraqua/WEB-INF/aquaplugins</PLUGIN_MANAGER><REPOSITORY><SERVER>127.0.0.1:8080/openrdf-sesame</SERVER><PROXY></PROXY><PORT></PORT><LOGIN></LOGIN><PASSWORD></PASSWORD><PLUGIN_TYPE>sesame2</PLUGIN_TYPE><REPOSITORY_NAME>isp</REPOSITORY_NAME><TYPE>OWL</TYPE></REPOSITORY></CONFIGURATION>

to:

<?xml version="1.0" encoding="UTF-8"?><CONFIGURATION><PLUGIN_MANAGER>/var/lib/tomcat7/webapps/poweraqua/WEB-INF/aquaplugins</PLUGIN_MANAGER><REPOSITORY><SERVER>http://127.0.0.1:8080/openrdf-sesame</SERVER><PROXY></PROXY><PORT></PORT><LOGIN></LOGIN><PASSWORD></PASSWORD><PLUGIN_TYPE>sesame2</PLUGIN_TYPE><REPOSITORY_NAME>isp</REPOSITORY_NAME><TYPE>OWL</TYPE></REPOSITORY></CONFIGURATION>

(note, I might need to use localhost instead of 127.0.0.1)

Also in /var/lib/tomcat7/webapps/poweraqua/indexListInformation/indexbrentweb, change service_properties.xml from:

<?xml version="1.0" encoding="UTF-8"?>
<CONFIGURATION>
<PLUGIN_MANAGER>/var/lib/tomcat7/webapps/poweraqua/WEB-INF/aquaplugins</PLUGIN_MANAGER>
<REPOSITORY>
    <SERVER>127.0.0.1:8080/openrdf-sesame</SERVER>
    <PROXY></PROXY>
    <PORT></PORT>
    <LOGIN></LOGIN>
    <PASSWORD></PASSWORD>
    <PLUGIN_TYPE>sesame2</PLUGIN_TYPE>
    <REPOSITORY_NAME>isp</REPOSITORY_NAME>
    <TYPE>OWL</TYPE>
</REPOSITORY>
</CONFIGURATION>

to:

<?xml version="1.0" encoding="UTF-8"?>
<CONFIGURATION>
<PLUGIN_MANAGER>/var/lib/tomcat7/webapps/poweraqua/WEB-INF/aquaplugins</PLUGIN_MANAGER>
<REPOSITORY>
    <SERVER>http://127.0.0.1:8080/openrdf-sesame</SERVER>
    <PROXY></PROXY>
    <PORT></PORT>
    <LOGIN></LOGIN>
    <PASSWORD></PASSWORD>
    <PLUGIN_TYPE>sesame2</PLUGIN_TYPE>
    <REPOSITORY_NAME>isp</REPOSITORY_NAME>
    <TYPE>OWL</TYPE>
</REPOSITORY>
</CONFIGURATION>

After running the shell script: /var/lib/tomcat7/webapps/poweraqua# ./createLuceneIndex.sh

the following log results:
https://gist.github.com/bshambaugh/d00017026e916d917030628c0ebec7b7

tl;dr: it helped a lot to put http in the server path before 127.0.0.1, so I avoid line 1152 "java.lang.IllegalStateException: unsupported protocol: '127.0.0.1'" in  https://gist.github.com/bshambaugh/c06f3b2b784f47e5a6e123df2ab42fed

./createLuceneIndex.sh also produced the following changes to the MySQL table:


But ontologyindextable is empty :( .



Backup of the ontology on gist: https://gist.github.com/bshambaugh/04581f98faa875e87c96684566de7ad8

Loading PowerAqua at http://localhost:8080/poweraqua/jsp/init.jsp gives:




What I worked on Yesterday

I played with jQuery dialog boxes yesterday [1], thought about media queries to adjust the CSS grid layout, and read about scaling SVG documents [2] as well as button creation [3] so I can make my own scaleable [2] buttons.

 [1] https://jqueryui.com/dialog/#modal-form
 [2] https://css-tricks.com/scale-svg/
 [3]
https://www.youtube.com/watch?v=iOWzFqrdOVk

Friday, April 28, 2017

Status Log: Still Unable Populate MySQL tables with Lucene Index Script

I'm sharing what I have so far for the createLuceneIndex.sh file. Maybe I'll figure it out eventually.  The error log is linked to at the end.

I created a shell script to create the LuceneIndex at
https://gist.github.com/bshambaugh/42c1accf6d2e5dc607a8d46047cc98be .

I manually created databases ontologyindexrelation and metadataindex.

The script created the following tables in the database metadataindex:

indexbrentwebdirectclasses
indexbrentwebdirectsubclasses
indexbrentwebdirectsuperclasses
indexbrentwebequivalent
indexbrentwebsubclasses
indexbrentwebsuperclasses

The database tables remain empty.
Expect the database tables to contain the columns: id, ontologyId, entityURI, classURI, and classLabel

The database ontologyindexrelation contains no tables.
Expect the table ontologyindextable with the columns: id, ontologyId, and indexManagerId

I manually created ./poweraqua/indexListInformation/indexbrentweb:

with service_properties.xml

<?xml version="1.0" encoding="UTF-8"?>
<CONFIGURATION>
<PLUGIN_MANAGER>/var/lib/tomcat7/webapps/poweraqua/WEB-INF/aquaplugins</PLUGIN_MANAGER>
<REPOSITORY>
    <SERVER>127.0.0.1:8080/openrdf-sesame</SERVER>
    <PROXY></PROXY>
    <PORT></PORT>
    <LOGIN></LOGIN>
    <PASSWORD></PASSWORD>
    <PLUGIN_TYPE>sesame2</PLUGIN_TYPE>
    <REPOSITORY_NAME>isp</REPOSITORY_NAME>
    <TYPE>OWL</TYPE>
</REPOSITORY>
</CONFIGURATION>

and index_properties.xml

<?xml version="1.0" encoding="UTF-8"?>
<CONFIGURATION>
<INDEX>
<INDEX_DIRECTORY>indexbrentweb/index_dir/</INDEX_DIRECTORY>
<SPELL_INDEX_DIRECTORY>indexbrentweb/spell_index_dir/</SPELL_INDEX_DIRECTORY>
<METADATA_INDEX_DB>jdbc:mysql://127.0.0.1:3306/metadataindex</METADATA_INDEX_DB>
<METADATA_INDEX_DB_LOGIN>root</METADATA_INDEX_DB_LOGIN>
<METADATA_INDEX_DB_PASSWORD>your_password</METADATA_INDEX_DB_PASSWORD>
<METADATA_INDEX_TABLE>indexbrentweb</METADATA_INDEX_TABLE>
</INDEX>
</CONFIGURATION>

I copied the index_properties.xml and service_properties.xml to the global files in

./poweraqua/

My multi_index_properties.xml looks like:

<?xml version="1.0" encoding="UTF-8"?>
<CONFIGURATION>
        <WATSON>false</WATSON>
        <POWERMAP>true</POWERMAP>
        <VIRTUOSO>false</VIRTUOSO>
        <REMOTESPARQLVIRTUOSO>false</REMOTESPARQLVIRTUOSO>
<ONTOLOGY_INDEX_DB>jdbc:mysql://127.0.0.1:3306/ontologyindexrelation</ONTOLOGY_INDEX_DB>
<ONTOLOGY_INDEX_DB_LOGIN>root</ONTOLOGY_INDEX_DB_LOGIN>
<ONTOLOGY_INDEX_DB_PASSWORD>your_password</ONTOLOGY_INDEX_DB_PASSWORD>
<INDEX_GLOBAL_PATH>./LuceneIndexes/</INDEX_GLOBAL_PATH>
<INDEX_INFO_FOLDER>./indexListInformation/indexbrentweb/</INDEX_INFO_FOLDER>
</CONFIGURATION>

./LuceneIndexes now contains:

.
└── indexbrentweb
    ├── index_dir
    │   ├── _instances
    │   │   ├── segments_c
    │   │   └── segments.gen
    │   ├── segments_c
    │   └── segments.gen
    └── spell_index_dir
        ├── _instances
        │   ├── segments_1
        │   └── segments.gen
        ├── segments_1
        └── segments.gen

My error log looks like:

https://gist.github.com/bshambaugh/c06f3b2b784f47e5a6e123df2ab42fed
Conclusions:

At this point, I think that commons-http-client-3.1 might be out of date.

I'm ignoring SLF4J errors for now. I ran createSesame2Repository.sh and it successfully created a full repository in sesame (I had to create the repository isp though and change the below part of Sesame2URLDatabaseTransformer.java and recompile to Sesame2URLDatabaseTransformer.class via Netbeans

 public static void main(String[] args)
  {
    String sesameServerPath = "http://kmi-web03:8080/openrdf-sesame/";
    String repositoryName = "evoont-seals_10000K_final";

    String path = "http://kmi.open.ac.uk/technologies/poweraqua/evoont-seals_10000K_final.owl";
    String baseURI = "";
    createDBFromURI(sesameServerPath, repositoryName, path, "RDF", baseURI);
  }

)
This looks weird: Getting Services from 127.0.0.1:8080/openrdf-sesame isp
I changed all localhost instances in the config files to 127.0.0.1 .

Sidenote: I have no idea why this is hardcoded:
"
public static void main(String[] args)
{
RepositoryVirtuoso repository = new RepositoryVirtuoso();
repository.setRepositoryName("jdbc:virtuoso://kmi-dev02.open.ac.uk:8890#http://geography.org");
System.out.print(repository.getGraphIRI());
}"

https://github.com/bshambaugh/PowerAqua-decompiled/blob/master/lib/poweraqua/serviceConfig/RepositoryVirtuoso.java
I did include the downloaded class file in a jar file in the CLASSPATH of createLuceneIndex.sh

/var/lib/tomcat7/webapps/poweraqua/WEB-INF/lib/serviceConfig.jar

Thursday, April 27, 2017

Create a createLuceneIndex.sh file that works: [pt4}:

Remove .DS_Store file:

Remove from the filesystem and the CLASSPATH:
log4j-1.2.15.jar  logback-classic-0.9.9.jar  slf4j-jdk14-1.5.0.jar


I don't know what apache axis is in the log file:

https://gist.github.com/bshambaugh/06abc750eed9346a1f52674bf89c98a0

You can download the used version here?

http://www.apache.org/dyn/closer.cgi/ws/axis/1_4

Try removing the requirement in the classpath and see if the error goes away..

/var/lib/tomcat7/webapps/poweraqua/myLuceneLib/lib/axis-ant.jar  
 /var/lib/tomcat7/webapps/poweraqua/WEB-INF/lib/axis.jar



I get as the response:

https://gist.github.com/bshambaugh/2abbcd0f99457d90106b8ac5535afa80

SO apparently WatsonPlugin.WatsonPlugin  needs axis, which I removed from the CLASSPATH
i.e.: "Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/axis/client/Service ..."

Maybe it is this::



"

Internationalization

If you make changes to the source code that results in the generation of text (error messages or debug information), you must follow the following guidelines to ensure that your text is properly translated.

Developer Guidelines

  1. Your text string should be added as a property to the resource.properties file (xml-axis/java/src/org/apache/axis/i18n/resource.properties). Note that some of the utility applications (i.e. tcpmon) have their own resource property files (tcpmon.properties)." (http://axis.apache.org/axis/java/developers-guide.html) 
Well it looks like /home/brent/Downloads/axis/org/apache/axis/i18n/resource_ja.properties and  /home/brent/Downloads/axis/org/apache/axis/i18n/resource.properties were never changed...

maybe I just need to add the properties file to the class path as described here:
http://stackoverflow.com/questions/2083159/cant-find-bundle-for-base-name

Wednesday, April 26, 2017

Create a createLuceneIndex.sh file that works: [pt3}:


createLuceneIndex.sh now creates:
https://gist.github.com/bshambaugh/b3782d15b24668d8db6531e32d9ee7be

so change in multi_index_properties.xml:

<ONTOLOGY_INDEX_DB>jdbc:mysql://localhost:3306/ontologyindexrelation</ONTOLOGY_INDEX_DB>

<ONTOLOGY_INDEX_DB>jdbc:mysql://127.0.0.1:3306/ontologyindexrelation</ONTOLOGY_INDEX_DB>

and I get:

https://gist.github.com/bshambaugh/56f04274201e00716a8cc4fd0af7fce7

it could be the http-client I am using ( a google search gives me):

https://jira.duraspace.org/browse/DS-1937

https://issues.apache.org/jira/browse/HTTPCLIENT-897

So maybe I need to try a later version of the httpclient???

http://hc.apache.org/

https://mvnrepository.com/artifact/commons-httpclient/commons-httpclient

now this: so change code where appropriate:

https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient

Create a createLuceneIndex.sh file that works: [pt2}:

Deleting service_properties.xml and index_properties.xml gives:


Imposible to read the configuration file /var/lib/tomcat7/webapps/poweraqua/service_properties.xml (No such file or directory)
java.io.FileNotFoundException: /var/lib/tomcat7/webapps/poweraqua/service_properties.xml (No such file or directory)
    at java.io.FileInputStream.open0(Native Method)
    at java.io.FileInputStream.open(FileInputStream.java:195)
    at java.io.FileInputStream.<init>(FileInputStream.java:138)
    at java.io.FileInputStream.<init>(FileInputStream.java:93)
    at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
    at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)
    at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
    at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
    at poweraqua.serviceConfig.ServiceConfiguration.readConfiguration(ServiceConfiguration.java:73)
    at poweraqua.serviceConfig.ServiceConfiguration.readConfigurationFile(ServiceConfiguration.java:52)
    at poweraqua.indexingService.creator.IndexingCreator.<init>(IndexingCreator.java:56)
    at poweraqua.indexingService.creator.IndexingCreator.main(IndexingCreator.java:650)
Exception in thread "main" java.lang.NullPointerException
    at poweraqua.serviceConfig.ServiceConfiguration.readConfiguration(ServiceConfiguration.java:82)
    at poweraqua.serviceConfig.ServiceConfiguration.readConfigurationFile(ServiceConfiguration.java:52)
    at poweraqua.indexingService.creator.IndexingCreator.<init>(IndexingCreator.java:56)
    at poweraqua.indexingService.creator.IndexingCreator.main(IndexingCreator.java:650)

Creating service_properties.xml as an empty file gives:

Creating standard index for entities (Classes, properties, instances, literals): type-URI-labe
Number of indexes is 1
creating new Conexion for the database index ontology jdbc:mysql://localhost:3306/ontologyindexrelation ************
[Fatal Error] :-1:-1: Premature end of file.
Imposible to read the configuration file Premature end of file.
org.xml.sax.SAXParseException; Premature end of file.
    at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
    at poweraqua.serviceConfig.ServiceConfiguration.readConfiguration(ServiceConfiguration.java:73)
    at poweraqua.serviceConfig.ServiceConfiguration.readConfigurationFile(ServiceConfiguration.java:52)
    at poweraqua.indexingService.creator.IndexingCreator.<init>(IndexingCreator.java:56)
    at poweraqua.indexingService.creator.IndexingCreator.main(IndexingCreator.java:650)
Exception in thread "main" java.lang.NullPointerException
    at poweraqua.serviceConfig.ServiceConfiguration.readConfiguration(ServiceConfiguration.java:82)
    at poweraqua.serviceConfig.ServiceConfiguration.readConfigurationFile(ServiceConfiguration.java:52)
    at poweraqua.indexingService.creator.IndexingCreator.<init>(IndexingCreator.java:56)
    at poweraqua.indexingService.creator.IndexingCreator.main(IndexingCreator.java:650)


Copying service_properties.xml to the global file gives:

<?xml version="1.0" encoding="UTF-8"?>
<CONFIGURATION>
<PLUGIN_MANAGER>/var/lib/tomcat7/webapps/poweraqua/WEB-INF/aquaplugins</PLUGIN_MANAGER>
<REPOSITORY>
    <SERVER>localhost:8080/openrdf-sesame</SERVER>
    <PROXY></PROXY>
    <PORT></PORT>
    <LOGIN></LOGIN>
    <PASSWORD></PASSWORD>
    <PLUGIN_TYPE>sesame2</PLUGIN_TYPE>
    <REPOSITORY_NAME>isp</REPOSITORY_NAME>
    <TYPE>OWL</TYPE>
</REPOSITORY>
</CONFIGURATION>

Creating standard index for entities (Classes, properties, instances, literals): type-URI-label
Number of indexes is 1
creating new Conexion for the database index ontology jdbc:mysql://localhost:3306/ontologyindexrelation ************
Number of repositories in xml file is 1
java.io.FileNotFoundException: /var/lib/tomcat7/webapps/poweraqua/index_properties.xml (No such file or directory)
    at java.io.FileInputStream.open0(Native Method)
    at java.io.FileInputStream.open(FileInputStream.java:195)
    at java.io.FileInputStream.<init>(FileInputStream.java:138)
    at java.io.FileInputStream.<init>(FileInputStream.java:93)
    at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
    at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)
    at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
    at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
    at poweraqua.indexingService.manager.IndexServiceConfiguration.readConfiguration(IndexServiceConfiguration.java:66)
    at poweraqua.indexingService.manager.IndexServiceConfiguration.readConfigurationFile(IndexServiceConfiguration.java:51)
    at poweraqua.indexingService.creator.IndexingCreator.<init>(IndexingCreator.java:57)
    at poweraqua.indexingService.creator.IndexingCreator.main(IndexingCreator.java:650)
Exception in thread "main" java.lang.NullPointerException
    at poweraqua.indexingService.manager.IndexServiceConfiguration.readConfiguration(IndexServiceConfiguration.java:74)
    at poweraqua.indexingService.manager.IndexServiceConfiguration.readConfigurationFile(IndexServiceConfiguration.java:51)
    at poweraqua.indexingService.creator.IndexingCreator.<init>(IndexingCreator.java:57)
    at poweraqua.indexingService.creator.IndexingCreator.main(IndexingCreator.java:650)

Creating an empty index_properties.xml file:

Creating standard index for entities (Classes, properties, instances, literals): type-URI-label
Number of indexes is 1
creating new Conexion for the database index ontology jdbc:mysql://localhost:3306/ontologyindexrelation ************
Number of repositories in xml file is 1
[Fatal Error] :-1:-1: Premature end of file.
org.xml.sax.SAXParseException; Premature end of file.
    at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
    at poweraqua.indexingService.manager.IndexServiceConfiguration.readConfiguration(IndexServiceConfiguration.java:66)
    at poweraqua.indexingService.manager.IndexServiceConfiguration.readConfigurationFile(IndexServiceConfiguration.java:51)
    at poweraqua.indexingService.creator.IndexingCreator.<init>(IndexingCreator.java:57)
    at poweraqua.indexingService.creator.IndexingCreator.main(IndexingCreator.java:650)
Exception in thread "main" java.lang.NullPointerException
    at poweraqua.indexingService.manager.IndexServiceConfiguration.readConfiguration(IndexServiceConfiguration.java:74)
    at poweraqua.indexingService.manager.IndexServiceConfiguration.readConfigurationFile(IndexServiceConfiguration.java:51)
    at poweraqua.indexingService.creator.IndexingCreator.<init>(IndexingCreator.java:57)
    at poweraqua.indexingService.creator.IndexingCreator.main(IndexingCreator.java:650)

Copying the index_properties.xml file from ./indexListInformation/indexbrentweb/

<?xml version="1.0" encoding="UTF-8"?><CONFIGURATION><INDEX><INDEX_DIRECTORY>indexbrentweb/index_dir/</INDEX_DIRECTORY><SPELL_INDEX_DIRECTORY>indexbrentweb/spell_index_dir/</SPELL_INDEX_DIRECTORY><METADATA_INDEX_DB>jdbc:mysql://localhost:3306/metadataindex</METADATA_INDEX_DB><METADATA_INDEX_DB_LOGIN>root</METADATA_INDEX_DB_LOGIN><METADATA_INDEX_DB_PASSWORD>password</METADATA_INDEX_DB_PASSWORD><METADATA_INDEX_TABLE>indexbrentweb</METADATA_INDEX_TABLE></INDEX></CONFIGURATION>

Creating standard index for entities (Classes, properties, instances, literals): type-URI-label
Number of indexes is 1
creating new Conexion for the database index ontology jdbc:mysql://localhost:3306/ontologyindexrelation ************
Number of repositories in xml file is 1
Number of indexes is 1
Imposible to read the configuration file /var/lib/tomcat7/webapps/poweraqua/indexListInformation/indexbrentwebservice_properties.xml (No such file or directory)
java.io.FileNotFoundException: /var/lib/tomcat7/webapps/poweraqua/indexListInformation/indexbrentwebservice_properties.xml (No such file or directory)
    at java.io.FileInputStream.open0(Native Method)
    at java.io.FileInputStream.open(FileInputStream.java:195)
    at java.io.FileInputStream.<init>(FileInputStream.java:138)
    at java.io.FileInputStream.<init>(FileInputStream.java:93)
    at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
    at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)
    at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
    at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
    at poweraqua.serviceConfig.ServiceConfiguration.readConfiguration(ServiceConfiguration.java:73)
    at poweraqua.serviceConfig.ServiceConfiguration.readConfigurationFile(ServiceConfiguration.java:56)
    at poweraqua.serviceConfig.MultiOntologyManager.<init>(MultiOntologyManager.java:51)
    at poweraqua.indexingService.creator.IndexingCreator.createIndex(IndexingCreator.java:73)
    at poweraqua.indexingService.creator.IndexingCreator.createMultipleIndexes(IndexingCreator.java:549)
    at poweraqua.indexingService.creator.IndexingCreator.createMultipleIndexes(IndexingCreator.java:556)
    at poweraqua.indexingService.creator.IndexingCreator.main(IndexingCreator.java:652)
java.lang.NullPointerException
    at poweraqua.serviceConfig.ServiceConfiguration.readConfiguration(ServiceConfiguration.java:82)
    at poweraqua.serviceConfig.ServiceConfiguration.readConfigurationFile(ServiceConfiguration.java:56)
    at poweraqua.serviceConfig.MultiOntologyManager.<init>(MultiOntologyManager.java:51)
    at poweraqua.indexingService.creator.IndexingCreator.createIndex(IndexingCreator.java:73)
    at poweraqua.indexingService.creator.IndexingCreator.createMultipleIndexes(IndexingCreator.java:549)
    at poweraqua.indexingService.creator.IndexingCreator.createMultipleIndexes(IndexingCreator.java:556)
    at poweraqua.indexingService.creator.IndexingCreator.main(IndexingCreator.java:652)

Modify multi_index_properties.xml:

Go from:
<INDEX_INFO_FOLDER>./indexListInformation/indexbrentweb</INDEX_INFO_FOLDER>

to:
<INDEX_INFO_FOLDER>./indexListInformation/indexbrentweb/</INDEX_INFO_FOLDER>

gives:

22:23:29.823 [main] DEBUG o.a.commons.httpclient.HttpClient - Operating system name: Linux
22:23:29.824 [main] DEBUG o.a.commons.httpclient.HttpClient - Operating system architecture: amd64
22:23:29.824 [main] DEBUG o.a.commons.httpclient.HttpClient - Operating system version: 3.13.0-44-generic
22:23:30.191 [main] DEBUG o.a.commons.httpclient.HttpClient - SUN 1.8: SUN (DSA key/parameter generation; DSA signing; SHA-1, MD5 digests; SecureRandom; X.509 certificates; JKS & DKS keystores; PKIX CertPathValidator; PKIX CertPathBuilder; LDAP, Collection CertStores, JavaPolicy Policy; JavaLoginConfig Configuration)
22:23:30.192 [main] DEBUG o.a.commons.httpclient.HttpClient - SunRsaSign 1.8: Sun RSA signature provider
22:23:30.192 [main] DEBUG o.a.commons.httpclient.HttpClient - SunEC 1.8: Sun Elliptic Curve provider (EC, ECDSA, ECDH)
22:23:30.192 [main] DEBUG o.a.commons.httpclient.HttpClient - SunJSSE 1.8: Sun JSSE provider(PKCS12, SunX509/PKIX key/trust factories, SSLv3/TLSv1/TLSv1.1/TLSv1.2)
22:23:30.192 [main] DEBUG o.a.commons.httpclient.HttpClient - SunJCE 1.8: SunJCE Provider (implements RSA, DES, Triple DES, AES, Blowfish, ARCFOUR, RC2, PBE, Diffie-Hellman, HMAC)
22:23:30.192 [main] DEBUG o.a.commons.httpclient.HttpClient - SunJGSS 1.8: Sun (Kerberos v5, SPNEGO)
22:23:30.193 [main] DEBUG o.a.commons.httpclient.HttpClient - SunSASL 1.8: Sun SASL provider(implements client mechanisms for: DIGEST-MD5, GSSAPI, EXTERNAL, PLAIN, CRAM-MD5, NTLM; server mechanisms for: DIGEST-MD5, GSSAPI, CRAM-MD5, NTLM)
22:23:30.193 [main] DEBUG o.a.commons.httpclient.HttpClient - XMLDSig 1.8: XMLDSig (DOM XMLSignatureFactory; DOM KeyInfoFactory; C14N 1.0, C14N 1.1, Exclusive C14N, Base64, Enveloped, XPath, XPath2, XSLT TransformServices)
22:23:30.193 [main] DEBUG o.a.commons.httpclient.HttpClient - SunPCSC 1.8: Sun PC/SC provider
Number of indexes is 1
********Indexing Semantic Entities in indexbrentweb/index_dir/
Opening Index : indexbrentweb/index_dir/
This shoul dnot be here, it is affecting the creation of indexes. And it is not Watson compatible
java.io.FileNotFoundException: no segments* file found in org.apache.lucene.store.FSDirectory@/var/lib/tomcat7/webapps/poweraqua/LuceneIndexes/indexbrentweb/index_dir/_instances: files:
    at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:604)
    at org.apache.lucene.index.DirectoryIndexReader.open(DirectoryIndexReader.java:115)
    at org.apache.lucene.index.IndexReader.open(IndexReader.java:316)
    at org.apache.lucene.index.IndexReader.open(IndexReader.java:206)
    at org.apache.lucene.search.IndexSearcher.<init>(IndexSearcher.java:47)
    at poweraqua.indexingService.manager.IndexManagerLucene.<init>(IndexManagerLucene.java:104)
    at poweraqua.indexingService.creator.IndexingCreator.createIndex(IndexingCreator.java:99)
    at poweraqua.indexingService.creator.IndexingCreator.createIndex(IndexingCreator.java:81)
    at poweraqua.indexingService.creator.IndexingCreator.createMultipleIndexes(IndexingCreator.java:549)
    at poweraqua.indexingService.creator.IndexingCreator.createMultipleIndexes(IndexingCreator.java:556)
    at poweraqua.indexingService.creator.IndexingCreator.main(IndexingCreator.java:652)
creating new Conexion for the metadata jdbc:mysql://localhost:3306/metadataindex ************
Imposible to drop table
metadata tables created ..
Imposible to drop table
metadata tables created ..
Imposible to drop table
metadata tables created ..
Imposible to drop table
metadata tables created ..
Imposible to drop table
metadata tables created ..
Imposible to drop table
metadata tables created ..
Indexing osPlugin number 1 isp : !!!!!!!!!!!!!!!!
Reading all properties
Fail to execute:  select p,o,r,l,ol,rl from {p} rdf:type {X}, [{p} rdfs:domain {o}, [{o} rdfs:label {ol}]], [{p} rdfs:range {r}, [{r} rdfs:label {rl}]], [{p} rdfs:label {l}] where  X = <http://www.w3.org/2002/07/owl#ObjectProperty> or X = <http://www.w3.org/2002/07/owl#DataProperty> or X = <http://www.w3.org/2002/07/owl#DatatypeProperty> or X = <http://www.w3.org/1999/02/22-rdf-syntax-ns#Property> limit 10000 offset 0
java.lang.IllegalStateException: unsupported protocol: 'localhost'
    at org.apache.commons.httpclient.protocol.Protocol.lazyRegisterProtocol(Protocol.java:149)
    at org.apache.commons.httpclient.protocol.Protocol.getProtocol(Protocol.java:117)
    at org.apache.commons.httpclient.HttpHost.<init>(HttpHost.java:107)
    at org.apache.commons.httpclient.HttpMethodBase.setURI(HttpMethodBase.java:280)
    at org.apache.commons.httpclient.HttpMethodBase.<init>(HttpMethodBase.java:220)
    at org.apache.commons.httpclient.methods.ExpectContinueMethod.<init>(ExpectContinueMethod.java:93)
    at org.apache.commons.httpclient.methods.EntityEnclosingMethod.<init>(EntityEnclosingMethod.java:119)
    at org.apache.commons.httpclient.methods.PostMethod.<init>(PostMethod.java:106)
    at org.openrdf.http.client.HTTPClient.getQueryMethod(HTTPClient.java:464)
    at org.openrdf.http.client.HTTPClient.sendTupleQuery(HTTPClient.java:407)
    at org.openrdf.http.client.HTTPClient.sendTupleQuery(HTTPClient.java:393)
    at org.openrdf.repository.http.HTTPTupleQuery.evaluate(HTTPTupleQuery.java:41)
    at Sesame2Plugin.Sesame2Plugin.execute(Sesame2Plugin.java:2597)
    at Sesame2Plugin.Sesame2Plugin.getAllPropertiesPeriodically(Sesame2Plugin.java:350)
    at poweraqua.indexingService.creator.IndexingCreator.addInformationToIndexPeriodically(IndexingCreator.java:336)
    at poweraqua.indexingService.creator.IndexingCreator.createIndex(IndexingCreator.java:104)
    at poweraqua.indexingService.creator.IndexingCreator.createIndex(IndexingCreator.java:81)
    at poweraqua.indexingService.creator.IndexingCreator.createMultipleIndexes(IndexingCreator.java:549)
    at poweraqua.indexingService.creator.IndexingCreator.createMultipleIndexes(IndexingCreator.java:556)
    at poweraqua.indexingService.creator.IndexingCreator.main(IndexingCreator.java:652)
Imposible to add the information to the index *********************************
java.lang.NullPointerException
    at Sesame2Plugin.Sesame2Plugin.getAllPropertiesPeriodically(Sesame2Plugin.java:367)
    at poweraqua.indexingService.creator.IndexingCreator.addInformationToIndexPeriodically(IndexingCreator.java:336)
    at poweraqua.indexingService.creator.IndexingCreator.createIndex(IndexingCreator.java:104)
    at poweraqua.indexingService.creator.IndexingCreator.createIndex(IndexingCreator.java:81)
    at poweraqua.indexingService.creator.IndexingCreator.createMultipleIndexes(IndexingCreator.java:549)
    at poweraqua.indexingService.creator.IndexingCreator.createMultipleIndexes(IndexingCreator.java:556)
    at poweraqua.indexingService.creator.IndexingCreator.main(IndexingCreator.java:652)

Create a createLuceneIndex.sh file that works [pt2]:

metadataindex , ontologyindexrelation

Try:


mysql -u root -p

CREATE DATABASE metadataindex;
CREATE DATABASE ontologyindexrelation;

Creating standard index for entities (Classes, properties, instances, literals): type-URI-label
Number of indexes is 1
creating new Conexion for the database index ontology jdbc:mysql://localhost:3306/ontologyindexrelation ************

Exception in thread "main" java.lang.NullPointerException
    at poweraqua.serviceConfig.ServiceConfiguration.readConfiguration(ServiceConfiguration.java:86)
    at poweraqua.serviceConfig.ServiceConfiguration.readConfigurationFile(ServiceConfiguration.java:52)
    at poweraqua.indexingService.creator.IndexingCreator.<init>(IndexingCreator.java:56)
    at poweraqua.indexingService.creator.IndexingCreator.main(IndexingCreator.java:650)

(ServiceConfiguration.java:86)

NodeList repositories = configuration.getElementsByTagName("REPOSITORY");
System.out.println("Number of repositories in xml file is " + repositories.getLength());
for (int i = 0; i < repositories.getLength(); i++)

(ServiceConfiguration.java:52)

public void writeConfigurationFile()
{
createConfigurationFile("service_properties.xml");
}


(IndexingCreator.java:56)

String IndexInformationFolder = indexInformationBean.getIndexFolder();
MultiOntologyManager multiOntologyManager = new MultiOntologyManager(IndexInformationFolder);
IndexServiceConfiguration index = new IndexServiceConfiguration();
index.readConfigurationFile(IndexInformationFolder);
IndexBean indexBean = (IndexBean)index.getIndexList().get(0);




Tuesday, April 25, 2017

Create a createLuceneIndex.sh file that works:

./indexListInformation/indexkmiweb07-mysql

index_properties.xml:

<?xml version="1.0" encoding="UTF-8"?>
<CONFIGURATION>
<INDEX>
<INDEX_DIRECTORY>indexkmiweb07mysql/index_dir/</INDEX_DIRECTORY>
<SPELL_INDEX_DIRECTORY>indexkmiweb07mysql/spell_index_dir/</SPELL_INDEX_DIRECTORY>
<METADATA_INDEX_DB>jdbc:mysql://localhost:3306/metadataindex</METADATA_INDEX_DB>
<METADATA_INDEX_DB_LOGIN>root</METADATA_INDEX_DB_LOGIN>
<METADATA_INDEX_DB_PASSWORD />
<METADATA_INDEX_TABLE>indexkmiweb07mysql</METADATA_INDEX_TABLE>
</INDEX></CONFIGURATION>

service_properties.xml

<?xml version="1.0" encoding="UTF-8"?>^M
<CONFIGURATION>^M
<PLUGIN_MANAGER>/Applications/apache-tomcat-5.5.23/webapps/powerAqua/WEB-INF/aquaplugins</PLUGIN_MANAGER>
^M
<REPOSITORY>
        <SERVER>http://kmi-web03.open.ac.uk:8080/sesame</SERVER>
        <PROXY>wwwcache.open.ac.uk</PROXY>
        <PORT>80</PORT>
        <LOGIN></LOGIN>
        <PASSWORD></PASSWORD>
        <PLUGIN_TYPE>sesame</PLUGIN_TYPE>
        <REPOSITORY_NAME>upm_lia</REPOSITORY_NAME>
        <TYPE>RDF</TYPE>
</REPOSITORY>
<REPOSITORY>
        <SERVER>http://kmi-web03.open.ac.uk:8080/sesame</SERVER>
        <PROXY>wwwcache.open.ac.uk</PROXY>
        <PORT>80</PORT>
        <LOGIN></LOGIN>
        <PASSWORD></PASSWORD>
        <PLUGIN_TYPE>sesame</PLUGIN_TYPE>
        <REPOSITORY_NAME>semanticconferences</REPOSITORY_NAME>
        <TYPE>RDF</TYPE>
</REPOSITORY>^M
</CONFIGURATION>^M

./indexListInformation/indexkmiweb07-linkeddata

index_properties.xml

<?xml version="1.0" encoding="UTF-8"?>
<CONFIGURATION>
<INDEX>
<INDEX_DIRECTORY>indexkmiweb07linkedata/index_dir/</INDEX_DIRECTORY>
<SPELL_INDEX_DIRECTORY>indexkmiweb07linkedata/spell_index_dir/</SPELL_INDEX_DIRECTORY>
<METADATA_INDEX_DB>jdbc:mysql://localhost:3306/metadataindex</METADATA_INDEX_DB>
<METADATA_INDEX_DB_LOGIN>root</METADATA_INDEX_DB_LOGIN>
<METADATA_INDEX_DB_PASSWORD />
<METADATA_INDEX_TABLE>indexkmiweb07linkedata</METADATA_INDEX_TABLE>
</INDEX></CONFIGURATION>


service_properties.xml

<?xml version="1.0" encoding="UTF-8"?>^M
<CONFIGURATION>^M
<PLUGIN_MANAGER>/Applications/apache-tomcat-5.5.23/webapps/powerAqua/WEB-INF/aquaplugins</PLUGIN_MANAGER> ^M
<REPOSITORY>^M
        <SERVER>http://kmi-web03.open.ac.uk:8080/sesame</SERVER>^M
        <PROXY>wwwcache.open.ac.uk</PROXY>^M
        <PORT>80</PORT>^M
        <LOGIN></LOGIN>^M
        <PASSWORD></PASSWORD>^M
        <PLUGIN_TYPE>sesame</PLUGIN_TYPE>^M
        <REPOSITORY_NAME>travel_destinations</REPOSITORY_NAME>^M
        <TYPE>OWL</TYPE>^M
</REPOSITORY>
<REPOSITORY>^M
        <SERVER>http://kmi-web03.open.ac.uk:8080/sesame</SERVER>^M
        <PROXY>wwwcache.open.ac.uk</PROXY>^M
        <PORT>80</PORT>^M
        <LOGIN></LOGIN>^M
        <PASSWORD></PASSWORD>^M
        <PLUGIN_TYPE>sesame</PLUGIN_TYPE>^M
        <REPOSITORY_NAME>mid_level_ontology</REPOSITORY_NAME>^M
        <TYPE>OWL</TYPE>^M
</REPOSITORY>^M
<REPOSITORY>^M
        <SERVER>http://kmi-web03.open.ac.uk:8080/sesame</SERVER>^M
        <PROXY>wwwcache.open.ac.uk</PROXY>^M
        <PORT>80</PORT>^M
        <LOGIN></LOGIN>^M
        <PASSWORD></PASSWORD>^M
        <PLUGIN_TYPE>sesame</PLUGIN_TYPE>^M
        <REPOSITORY_NAME>census</REPOSITORY_NAME>^M
        <TYPE>RDF</TYPE>^M
</REPOSITORY>^M
</CONFIGURATION>

Delete databases created from PowerAqua backup:

This is how they were created?
http://stackoverflow.com/questions/17666249/how-to-import-an-sql-file-using-the-command-line-in-mysql

mysql -u username -p database_name < file.sql


This is how they are dropped?
DROP DATABASE

https://www.cyberciti.biz/faq/how-do-i-empty-mysql-database/



mysql -u root -p (at the CLI)

DROP DATABASE metadataindex;  (Can't drop database 'metadataindex'; database doesn't exist)
DROP DATABASE ontologyindexrelation; (Query OK, 1 row affected (0.07 sec))








Monday, April 24, 2017

The sh createSesame2Repository.sh that works....

 Modify Sesame2URLDatabaseTransformer.java in the Sesame2Plugin folder.

replace the sesameServerPath, repositoryName, and path with desired strings.

public static void main(String[] args)
  {
    String sesameServerPath = "http://localhost:8080/openrdf-sesame/";
    String repositoryName = "isp";
   
    String path = "http://data.thespaceplan.com/isp.rdf";
    String baseURI = "";
    createDBFromURI(sesameServerPath, repositoryName, path, "RDF", baseURI);
  }

Compile it into Sesame2URLDatabaseTransformer.class using the library

openrdf-sesame-(version)-onejar.jar in the path





 Copy the resulting class file to Sesame2Plugin in the poweraqua folder with all the jar files in createSesame2Repository.sh . Specify the .jar file and class file locations in createSesame2Repository.sh .

Create the target respository isp

run sh createSesame2Repository.sh :



I have file directory mylib with the used files:

createSesame2Repository.sh   sesame2  Sesame2Plugin

sesame2 contains *.jar file , Sesame2Plugin contains *.class files

createSesame2Repository.sh contains:

cd /var/lib/tomcat7/webapps/poweraqua/myLib
CLASSPATH=$CLASSPATH:/var/lib/tomcat7/webapps/poweraqua/myLib/sesame2/openrdf-sesame-2.3-pr1-onejar.jar: ... .jar

export CLASSPATH

echo $CLASSPATH
java -Xmx1200M Sesame2Plugin.Sesame2URLDatabaseTransformer



I guess I need to run Sesame2URLDatabaseTransformer knowing how to include an external library

http://stackoverflow.com/questions/18093928/what-does-could-not-find-or-load-main-class-mean

solution ... cd up one directory and run:

java Sesame2Plugin.Sesame2URLDatabaseTransformer

Error: A JNI error has occurred, please check your installation and try again

http://stackoverflow.com/questions/22381202/a-jni-error-has-occurred-please-check-your-installation-and-try-again-in-eclips

Modifying the shell script to create a new Sesame Repository in PowerAqua

cat createSesame2Repository.sh | sed -e 's/projects\/BTCPowerAquaNetBeans\/myLib\/sesame2\/lib//g' | sed -e 's/\/Users\/vl474\/Trabajo\/NetBeans\\ /\/var\/lib\/tomcat7\/webapps\/poweraqua\/myLib\/sesame2/g'

Following: http://stackoverflow.com/questions/8084926/including-jar-files-in-class-path

This script calls:
https://github.com/bshambaugh/PowerAqua-decompiled/blob/master/aquaplugins/Sesame2Plugin/Sesame2URLDatabaseTransformer.java

It utilizes Sesame:

import org.openrdf.model.Resource;
import org.openrdf.repository.Repository;
import org.openrdf.repository.RepositoryConnection;
import org.openrdf.repository.http.HTTPRepository;
import org.openrdf.rio.RDFFormat;

This should come from(?):
openrdf-sesame-(version)-onejar.jar.

as described in:
http://graphdb.ontotext.com/sesame/users/ch02.html

Lines 121 - 129 in Sesame2URLDatabaseTransformer.java are telling:

public static void main(String[] args)
{
String sesameServerPath = "http://kmi-web03:8080/openrdf-sesame/";
String repositoryName = "evoont-seals_10000K_final";
String path = "http://kmi.open.ac.uk/technologies/poweraqua/evoont-seals_10000K_final.owl";
String baseURI = "";
createDBFromURI(sesameServerPath, repositoryName, path, "RDF", baseURI);
}

This tells me that I need to specify where the ontology is hosted with the String path.

The sesameServerPath will be where my Sesame Server is.

The repositoryName will be the name of my repository.

Compare sesameServerPath and repositoryName with service_properties.xml in https://github.com/bshambaugh/PowerAqua-decompiled/blob/master/service_properties.xml .

Note that the sesameServerPath is like <SERVER> and sesameServerPath + repositoryName is like <REPOSITORY_NAME>.


Also change the script to replace sesame*.jar and everything else in not-needed with:



http://grepcode.com/snapshot/repo1.maven.org/maven2/org.slf4j/slf4j-jdk14/1.5.0
https://www.slf4j.org/manual.html

Sunday, April 23, 2017

Files called by createSesame2Repository.sh in PowerAqua

Files called by createSesame2Repository.sh :

root /PowerAquaOpenSource/myLib/sesame2/

openrdf-sesame-2.3-pr1-onejar.jar
/lib/aduna-appbase-core-3.4.1.jar
/lib/aduna-appbase-logging-api-3.4.1.jar
/lib/aduna-appbase-logging-file-3.4.1.jar
/lib/aduna-appbase-webapp-base-core-3.4.1.jar
/lib/aduna-commons-collections-2.3.jar
/lib/aduna-commons-concurrent-2.2.jar
/lib/aduna-commons-i18n-1.0.jar
/lib/aduna-commons-io-2.4.jar
/lib/aduna-commons-iteration-2.3.jar
/lib/aduna-commons-lang-2.3.jar
/lib/aduna-commons-net-2.2.jar
/lib/aduna-commons-platform-info-2.4.jar
/lib/aduna-commons-text-2.2.jar
/lib/aduna-commons-webapp-core-2.4.jar
/lib/aduna-commons-xml-2.2.jar
/lib/aopalliance-1.0.jar
/lib/asm-1.5.3.jar
/lib/commons-cli-1.1.jar
/lib/commons-codec-1.3.jar
/lib/commons-dbcp-1.2.2.jar
/lib/commons-fileupload-1.2.1.jar
/lib/commons-httpclient-3.1.jar
/lib/commons-io-1.3.2.jar
/lib/commons-pool-1.3.jar
/not needed/jcl104-over-slf4j-1.5.0.jar
/lib/jstl-1.1.2.jar
/lib/logback-classic-0.9.9.jar
/lib/logback-core-0.9.9.jar
/not needed/sesame-console-2.2.4.jar
/not needed/sesame-http-client-2.2.4.jar
/not needed/sesame-http-protocol-2.2.4.jar
/not needed/sesame-http-server-spring-2.2.4.jar
/not needed/sesame-model-2.2.4.jar
/not needed/sesame-query-2.2.4.jar
/not needed/sesame-queryalgebra-evaluation-2.2.4.jar
/not needed/sesame-queryalgebra-model-2.2.4.jar
/not needed/sesame-queryparser-api-2.2.4.jar
/not needed/sesame-queryparser-serql-2.2.4.jar
/not needed/sesame-queryparser-sparql-2.2.4.jar
/not needed/sesame-queryresultio-api-2.2.4.jar
/not needed/sesame-queryresultio-binary-2.2.4.jar
/not needed/sesame-queryresultio-sparqljson-2.2.4.jar
/not needed/sesame-queryresultio-sparqlxml-2.2.4.jar
/not needed/sesame-queryresultio-text-2.2.4.jar
/not needed/sesame-repository-api-2.2.4.jar
/not needed/sesame-repository-contextaware-2.2.4.jar
/not needed/sesame-repository-dataset-2.2.4.jar
/not needed/sesame-repository-event-2.2.4.jar
/not needed/sesame-repository-http-2.2.4.jar
/not needed/sesame-repository-manager-2.2.4.jar
/not needed/sesame-repository-sail-2.2.4.jar
/not needed/sesame-rio-api-2.2.4.jar
/not needed/sesame-rio-n3-2.2.4.jar
/not needed/sesame-rio-ntriples-2.2.4.jar
/not needed/sesame-rio-rdfxml-2.2.4.jar
/not needed/sesame-rio-trig-2.2.4.jar
/not needed/sesame-rio-trix-2.2.4.jar
/not needed/sesame-rio-turtle-2.2.4.jar
/not needed/sesame-runtime-2.2.4.jar
/not needed/sesame-sail-api-2.2.4.jar
/not needed/sesame-sail-inferencer-2.2.4.jar
/not needed/sesame-sail-memory-2.2.4.jar
/not needed/sesame-sail-nativerdf-2.2.4.jar
/not needed/sesame-sail-rdbms-2.2.4.jar
/not needed/slf4j-api-1.5.0.jar
/not needed/slf4j-jdk14-1.5.0.jar
/lib/spring-aop-2.5.1.jar
/lib/spring-beans-2.5.1.jar
/lib/spring-context-2.5.1.jar
/lib/spring-context-support-2.5.1.jar
/lib/spring-core-2.5.1.jar
/lib/spring-web-2.5.1.jar
/lib/spring-webmvc-2.5.1.jar
/lib/standard-1.1.2.jar

First try at loading FOAF and configuring service_properties for PowerAqua

In service_properties.xml

<REPOSITORY>
      <SERVER>
        http://localhost:8080/openrdf-sesame/
      </SERVER>
      <PROXY></PROXY>
      <PORT>80</PORT>
      <LOGIN></LOGIN>
      <PASSWORD></PASSWORD>
      <PLUGIN_TYPE>sesame</PLUGIN_TYPE>
      <REPOSITORY_NAME>http://localhost:8080/openrdf-sesame/repositories/foaf</REPOSITORY_NAME>
      <TYPE>OWL</TYPE>
</REPOSITORY>

I created the repository at http://localhost:8080/openrdf-sesame/repositories/foaf

But I did all of the above manually. The instructions for PowerAqua suggest using a script called createSesame2Repository.sh .

Monday, April 17, 2017

How to add Sesame to PowerAqua (pt1)

Following previous posts:

look at repository information (http://localhost:8080/openrdf-workbench/repositories/test1/summary)

        Repository Location
    ID
        test1
      Title
        This is a test following Bob DuCharmes Blog Post
      Location
        http://localhost:8080/openrdf-sesame/repositories/test1
      Sesame server
        http://localhost:8080/openrdf-sesame
     

Compare this to the configuration file for PowerAqua:

https://github.com/bshambaugh/PowerAqua-decompiled/blob/master/service_properties.xml

loading openrdf-sesame

Starting with Bob Ducharme's blog: http://www.snee.com/bobdc.blog/2009/02/getting-started-with-sesame.html

Download Sesame 2.2.4 and Tomcat7

(first follow the tomcat and openrdf logging error mentioned in a previous post)
http://raptorlicious.blogspot.com/2017/04/spring-framework-tomcat-and-7openrdf.html

(Also click on the images below to make them large.)

See the openrdf-workbench welcome screen



Follow Bob DuCharme's instructions to create a Sesame repository:


See that the welcome screen has changed:

Upload a file:

sudo curl -T /opt/jena/src-examples/jena-examples/src/main/resources/data/pizza.owl.rdf -H "Content-Type: application/rdf+xml;charset=UTF-8" http://localhost:8080/openrdf-sesame/repositories/test1/statements)
 
Query though the GUI (as querying through the CLI like in Bob DuCharme's blog post does not work yet)




Upload an rdfs file per the documentation in Bob DuCharme's blog:

sudo curl -T rdftest1.rdf -H "Content-Type: application/rdf+xml;charset=UTF-8" http://localhost:8080/openrdf-sesame/repositories/rdftest1/statements