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









Applying literature to a Job Description on Indeed


http://careers.caci.com/ShowJob/Id/1112923/Java%20Software%20Developer

Reading between the lines (inferring from SPARQL and concurrent programming and latest rants):

Decomposing Federated Queries in presence of Replicated Fragments
Gabriela Montoya a, ̊ , Hala Skaf-Molli a , Pascal Molli a , Maria-Esther Vidal b (http://www.websemanticsjournal.org/index.php/ps/article/view/486/502)

spring framework --- tomcat and 7openrdf-sesame-2.24 (500 error)

I get:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'adunaAppConfig' defined in ServletContext resource [/WEB-INF/openrdf-http-server-servlet.xml]org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'adunaAppConfig' defined in ServletContext resource [/WEB-INF/openrdf-http-server-servlet.xml] ...

It looks like this is a GitHub Issue. Basically, you need:

https://github.com/ontop/ontop/issues/124

Yes, this fix works.

Now go to Bob DuCharme's blog post to see how to get started with Sesame:

http://www.snee.com/bobdc.blog/2009/02/getting-started-with-sesame.html



Using the child of Sesame , RDF4j in a Java Program

http://docs.rdf4j.org/rdf-tutorial/ references :

https://github.com/eclipse/rdf4j-doc/blob/master/examples/src/main/java/org/eclipse/rdf4j/examples/model/Example01BuildModel.java

It looks like the Examples in the GitHub repository can be run in the same way as the Java with Netbeans post.

Sunday, April 16, 2017

How to write a program in Java using Netbeans

 I started with:

http://www.wikihow.com/Write-Your-First-Program-in-Java

Then, I compiled a Netbeans project. Starting with create new project and create a new Java file named hello.java

public class hello {
   
    public static void main(String[] args) {
        System.out.println("Hello World.");
    }
}

The Java class file (hello.class) shows up in ~/NetBeansProjects/JavaApplication1/build/classes .


Saturday, April 15, 2017

Document Indexes for Lucene in PowerAqua

In the file multi_indexproperties.xml

there are two lines of code:

<INDEX_GLOBAL_PATH>/Applications/apache-tomcat-5.5.23/webapps/poweraqualinked/LuceneIndexes/</INDEX_GLOBAL_PATH>
<INDEX_INFO_FOLDER>./indexListInformation/indexkmiweb07-philips/</INDEX_INFO_FOLDER>

which is referenced by:

./PowerAqua-decompiled/lib/poweraqua/indexingService/creator/MultiIndexServiceConfiguration.java

---------------


list = configuration.getElementsByTagName("POWERMAP");
setPowermap(Boolean.valueOf(list.item(0).getFirstChild().getNodeValue()).booleanValue());
list = configuration.getElementsByTagName("VIRTUOSO");
setVirtuoso(Boolean.valueOf(list.item(0).getFirstChild().getNodeValue()).booleanValue());
list = configuration.getElementsByTagName("REMOTESPARQLVIRTUOSO");
setRemoteSPARQLVirtuoso(Boolean.valueOf(list.item(0).getFirstChild().getNodeValue()).booleanValue());
list = configuration.getElementsByTagName("ONTOLOGY_INDEX_DB");
setDb(list.item(0).getFirstChild().getNodeValue());
list = configuration.getElementsByTagName("ONTOLOGY_INDEX_DB_LOGIN");
setLogin(list.item(0).getFirstChild() != null ? list.item(0).getFirstChild().getNodeValue() : new String());
list = configuration.getElementsByTagName("ONTOLOGY_INDEX_DB_PASSWORD");
setPassword(list.item(0).getFirstChild() != null ? list.item(0).getFirstChild().getNodeValue() : new String());
list = configuration.getElementsByTagName("INDEX_GLOBAL_PATH");
setIndex_global_path(list.item(0).getFirstChild() != null ? list.item(0).getFirstChild().getNodeValue() : new String());

NodeList indexes = configuration.getElementsByTagName("INDEX_INFO_FOLDER");
System.out.println("Number of indexes is " + indexes.getLength());
this.indexList = new ArrayList();
for (int i = 0; i < indexes.getLength(); i++)
{
String indexFolder = indexes.item(i).getFirstChild() != null ? indexes.item(i).getFirstChild().getNodeValue() : null;
MultiOntologyIndexBean bean = new MultiOntologyIndexBean(indexFolder);
getIndexList().add(bean);
}
 ----------------

It fails if INDEX_GLOBAL_PATH or INDEX_INFO_FOLDER is called.. but it contains a null or nothing specified in the tag  ... I think this triggers new String() which triggers a stack trace

Friday, April 14, 2017

Documenting Sesame and RDF4j

 Sesame 4.1.2 became RDF4J 2.0. Documentation for rdf4j is here: http://docs.rdf4j.org/rdf-tutorial/ .
An older version of Sesame, 2.7, is documented here:
http://graphdb.ontotext.com/sesame/users/ch01.html

Sesame also provided a JDBC like interface:
https://docs.oracle.com/javase/tutorial/jdbc/basics/

In PowerAquaOpenSource there is a jar:

openrdf-sesame-2.3-pr1-onejar in ./PowerAquaOpenSource/myLib/sesame2/

In PowerAquaLinked there is a jar:

a-openrdf-sesame-2.3-pr1-onejar.jar in ./poweraqualinked/WEB-INF/lib/

The jar files in PowerAqua contain all of the relevant Sesame libraries for programming applications.

On source-forge I was able to download: openrdf-sesame-4.1.2-sdk.tar.gz. This contains complete binaries in jar files.

--------------------

Now I can play with the downloaded binaries for sesame-4.1.2:

Looking at:
http://graphdb.ontotext.com/sesame/users/ch06.html

I note that I can store the repositories on the file system, or on a sesame server.



When I chose ./openrdf-sesame-4.1.2/bin/".sh I get SYSTEM for the command "show repositories."

I get no server for "connect http://localhost:8080/openrdf-sesame."

Either I have no server, or it is not running on port 8080. port 8080 is the default.
(Documentation on setting up a server:
https://webthreeoh.wordpress.com/2012/06/18/installing-sesame-on-a-mac-mini/ ,
http://graphdb.ontotext.com/sesame/users/ch05.html)
A server is not needed if sesame is strictly used a library to program against.
However.

I look at the code for the Sesame2Plugin:
https://github.com/bshambaugh/PowerAqua-decompiled/tree/master/aquaplugins/Sesame2Plugin

and I notice that for ./Sesame2Plugin/Sesame2URLDatabaseTransformer.java there is:

import org.openrdf.repository.Repository;
import org.openrdf.repository.RepositoryConnection;
import org.openrdf.repository.http.HTTPRepository;

and

public static void createDBFromURI(String sesameServerPath, String repositoryName, String filePath, String format)

try
{
System.out.println("Uploading into repository " + sesameServerPath + repositoryName);
Repository myRepository = new HTTPRepository(sesameServerPath, repositoryName);
myRepository.initialize();
RepositoryConnection con = myRepository.getConnection();


Comparing this to  "8.2.1.4. Accessing a remote repository" in  http://graphdb.ontotext.com/sesame/users/ch08.html tells me that Sesame2URLDatabaseTransformer.java connects to an existing sesame repository.

In the other file in ./Sesame2Plugin/

looks like it is accessing a preexisting sesame server...

Thus for PowerAqua-decompiled/createSesame2Repository.sh

Thursday, April 13, 2017

Need to set up Sesame for PowerAqua (also Lucene?)

When looking at the PowerAqua installation instructions, it looks like I have to have some Sesame repositories set up. Here is the link to download Sesame:

https://sourceforge.net/projects/sesame/

Also check the PowerAqua repository to see if it already has Sesame (and Lucene). Find out what port it loads to.

Wednesday, April 12, 2017

Jar files referenced by createLucene2, createLucene, createSesameRepository, and createSesame2Repository in PoweAqua

createLucene2..

/Facility.jar
/KVDB.jar
/VirtuosoPlugin.jar
/arq.jar
/axis.jar
/concurrent.jar
/core.jar
/essepuntato.jar
/fusion.jar
/indexingService.jar
/indexingServiceVirtuoso.jar
/indexingServiceWatson.jar
/iri.jar
/jaxrpc.jar
/jdom.jar
/jena.jar
/jenatest.jar
/json.jar
/junit.jar
/jwnl.jar
/linguistic.jar
/ontotext.jar
/powerMap.jar
/poweraquaDB.jar
/queryWords.jar
/ranking.jar
/rio.jar
/saaj.jar
/sealsWrapper.jar
/serviceConfig.jar
/sesame.jar
/tests.jar
/tripleModel.jar
/trustEngine.jar
/utilities.jar
/wordnetJwnl.jar
/xercesImpl.jar
/xmlParserAPIs.jar
/yahoo.jar
/yahooweb.jar

createLucene..

/xmlParserAPIs.jar
/xercesImpl.jar
/core.jar
/indexingService.jar
/lucene.jar
/serviceConfig.jar
/poweraqualinkedDB.jar
/powerMap.jar
/rio.jar
/sesame.jar
/arq.jar
/concurrent.jar
/iri.jar
/jena.jar
/jenatest.jar
/json.jar
/junit.jar
/poweraquaDB.jar

brent@brent-laptop:~/Downloads/PowerAqua-decompiled$ cat createSesameRepository.sh\  | grep -o "/[A-Za-z]*.jar"
/xmlParserAPIs.jar
/xercesImpl.jar
/core.jar
/indexingService.jar
/lucene.jar
/serviceConfig.jar
/poweraquaDB.jar
/rio.jar
/sesame.jar
/arq.jar
/concurrent.jar
/iri.jar
/jena.jar
/jenatest.jar
/json.jar
/junit.jar
/SesamePlugin.jar

brent@brent-laptop:~/Downloads/PowerAqua-decompiled$ cat createSesame2Repository.sh | grep -o "/[A-Za-z0-9\.-]*.jar"
/openrdf-sesame-2.3-pr1-onejar.jar
/aduna-appbase-core-3.4.1.jar
/aduna-appbase-logging-api-3.4.1.jar
/aduna-appbase-logging-file-3.4.1.jar
/aduna-appbase-webapp-base-core-3.4.1.jar
/aduna-commons-collections-2.3.jar
/aduna-commons-concurrent-2.2.jar
/aduna-commons-i18n-1.0.jar
/aduna-commons-io-2.4.jar
/aduna-commons-iteration-2.3.jar
/aduna-commons-lang-2.3.jar
/aduna-commons-net-2.2.jar
/aduna-commons-platform-info-2.4.jar
/aduna-commons-text-2.2.jar
/aduna-commons-webapp-core-2.4.jar
/aduna-commons-xml-2.2.jar
/aopalliance-1.0.jar
/asm-1.5.3.jar
/commons-cli-1.1.jar
/commons-codec-1.3.jar
/commons-dbcp-1.2.2.jar
/commons-fileupload-1.2.1.jar
/commons-httpclient-3.1.jar
/commons-io-1.3.2.jar
/commons-pool-1.3.jar
/jcl104-over-slf4j-1.5.0.jar
/jstl-1.1.2.jar
/logback-classic-0.9.9.jar
/logback-core-0.9.9.jar
/sesame-console-2.2.4.jar
/sesame-http-client-2.2.4.jar
/sesame-http-protocol-2.2.4.jar
/sesame-http-server-spring-2.2.4.jar
/sesame-model-2.2.4.jar
/sesame-query-2.2.4.jar
/sesame-queryalgebra-evaluation-2.2.4.jar
/sesame-queryalgebra-model-2.2.4.jar
/sesame-queryparser-api-2.2.4.jar
/sesame-queryparser-serql-2.2.4.jar
/sesame-queryparser-sparql-2.2.4.jar
/sesame-queryresultio-api-2.2.4.jar
/sesame-queryresultio-binary-2.2.4.jar
/sesame-queryresultio-sparqljson-2.2.4.jar
/sesame-queryresultio-sparqlxml-2.2.4.jar
/sesame-queryresultio-text-2.2.4.jar
/sesame-repository-api-2.2.4.jar
/sesame-repository-contextaware-2.2.4.jar
/sesame-repository-dataset-2.2.4.jar
/sesame-repository-event-2.2.4.jar
/sesame-repository-http-2.2.4.jar
/sesame-repository-manager-2.2.4.jar
/sesame-repository-sail-2.2.4.jar
/sesame-rio-api-2.2.4.jar
/sesame-rio-n3-2.2.4.jar
/sesame-rio-ntriples-2.2.4.jar
/sesame-rio-rdfxml-2.2.4.jar
/sesame-rio-trig-2.2.4.jar
/sesame-rio-trix-2.2.4.jar
/sesame-rio-turtle-2.2.4.jar
/sesame-runtime-2.2.4.jar
/sesame-sail-api-2.2.4.jar
/sesame-sail-inferencer-2.2.4.jar
/sesame-sail-memory-2.2.4.jar
/sesame-sail-nativerdf-2.2.4.jar
/sesame-sail-rdbms-2.2.4.jar
/slf4j-api-1.5.0.jar
/slf4j-jdk14-1.5.0.jar
/spring-aop-2.5.1.jar
/spring-beans-2.5.1.jar
/spring-context-2.5.1.jar
/spring-context-support-2.5.1.jar
/spring-core-2.5.1.jar
/spring-web-2.5.1.jar
/spring-webmvc-2.5.1.jar
/standard-1.1.2.jar

Monday, April 10, 2017

Ontology Visualizers

Grafoo

http://www.essepuntato.it/graffoo/

VisualDataWeb

http://www.visualdataweb.org/index.php

Sunday, April 9, 2017

Guess at how to create MySQL Tables and Lucene Indexes with PowerAqua (pt1)

I really don't want to write code to create the Lucene indexes nor the mysql tables in metadataindex, and ontologyindexrelation. Fortunately, it looks like their might be code to do so in indexingService.jar :

To create the tables in database metadataindex (start with MetadataIndexManager):



























And finish with indexManagerLucene.class for Lucene Indexes:
































To create ontologyindextable in ontologyindexrelation database:







































Thanks to phpmyadmin for the database query and jd-gui (http://jd.benow.ca/)  for the Java decompiler to view the code.

Saturday, April 8, 2017

How to load part of the LuceneIndex of PowerAqua

Open up Luke:
































Search for terms in the ontology at https://www.w3.org/TR/2003/PR-owl-guide-20031215/food

Double click on a row for a result:















Choose "Copy Text to Clipboard: Complete Document" . Paste the result into a file:

stored/uncompressed,omitNorms<URI:http://www.w3.org/TR/2003/PR-owl-guide-20031209/food#PotableLiquid>
stored/uncompressed,omitNorms<entityLabel:PotableLiquid>
stored/uncompressed,omitNorms<entityType:class>
stored/uncompressed,omitNorms<pluginID:http://kmi-web07.open.ac.uk:8080/sesame/WINE_FOOD>


Once the file is complete, select URI, entityLabel, entityType, and pluginID

cat palucene.txt | grep -o "<URI.*>" | sed 's/URI://g' | sed 's/[<>]*//g'
cat palucene.txt | grep -o "<entityLabel.*>" | sed 's/entityLabel://g' | sed 's/[<>]*//g'
etc..

Put the result of each operation into a spreadsheet, and export as CSV to get a text file like below:


URI,entityLabel,entityType,pluginID
http://www.w3.org/TR/2003/PR-owl-guide-20031209/food#ConsumableThing,ConsumableThing,class,http://kmi-web07.open.ac.uk:8080/sesame/WINE_FOOD
http://www.w3.org/TR/2003/PR-owl-guide-20031209/food#NonConsumableThing,NonConsumableThing,class,http://kmi-web07.open.ac.uk:8080/sesame/WINE_FOOD
http://www.w3.org/TR/2003/PR-owl-guide-20031209/food#EdibleThing,EdibleThing,class,http://kmi-web07.open.ac.uk:8080/sesame/WINE_FOOD
http://www.w3.org/TR/2003/PR-owl-guide-20031209/food#PotableLiquid,PotableLiquid,class,http://kmi-web07.open.ac.uk:8080/sesame/WINE_FOOD
http://www.w3.org/TR/2003/PR-owl-guide-20031209/food#Wine,Wine,class,http://kmi-web07.open.ac.uk:8080/sesame/WINE_FOOD
http://www.w3.org/TR/2003/PR-owl-guide-20031209/food#madeFromFruit,madeFromFruit,property,http://kmi-web07.open.ac.uk:8080/sesame/WINE_FOOD
http://www.w3.org/TR/2003/PR-owl-guide-20031209/food#Fruit,Fruit,class,http://kmi-web07.open.ac.uk:8080/sesame/WINE_FOOD
http://www.w3.org/TR/2003/PR-owl-guide-20031209/food#Juice,Juice,class,http://kmi-web07.open.ac.uk:8080/sesame/WINE_FOOD
http://www.w3.org/TR/2003/PR-owl-guide-20031209/food#hasDrink,hasDrink,property,http://kmi-web07.open.ac.uk:8080/sesame/WINE_FOOD
http://www.w3.org/TR/2003/PR-owl-guide-20031209/food#MealCourse,MealCourse,class,http://kmi-web07.open.ac.uk:8080/sesame/WINE_FOOD
http://www.w3.org/TR/2003/PR-owl-guide-20031209/food#course,course,property,http://kmi-web07.open.ac.uk:8080/sesame/WINE_FOOD
http://www.w3.org/TR/2003/PR-owl-guide-20031209/food#Grape,Grape,class,http://kmi-web07.open.ac.uk:8080/sesame/WINE_FOOD
http://www.w3.org/TR/2003/PR-owl-guide-20031209/food#SweetFruit,SweetFruit,class,http://kmi-web07.open.ac.uk:8080/sesame/WINE_FOOD
http://www.w3.org/TR/2003/PR-owl-guide-20031209/food#Pasta,Pasta,class,http://kmi-web07.open.ac.uk:8080/sesame/WINE_FOOD
http://www.w3.org/TR/2003/PR-owl-guide-20031209/food#Meat,Meat,class,http://kmi-web07.open.ac.uk:8080/sesame/WINE_FOOD

Go to document: fileupload






















Then run a query to see that the document is loaded. (Earlier I created a schema).