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