001    /***************************************************************************/
002    /*  Copyright (C) 2010-2011, Sebastian Hellmann                            */
003    /*  Note: If you need parts of NLP2RDF in another licence due to licence   */
004    /*  incompatibility, please mail hellmann@informatik.uni-leipzig.de        */
005    /*                                                                         */
006    /*  This file is part of NLP2RDF.                                          */
007    /*                                                                         */
008    /*  NLP2RDF is free software; you can redistribute it and/or modify        */
009    /*  it under the terms of the GNU General Public License as published by   */
010    /*  the Free Software Foundation; either version 3 of the License, or      */
011    /*  (at your option) any later version.                                    */
012    /*                                                                         */
013    /*  NLP2RDF is distributed in the hope that it will be useful,             */
014    /*  but WITHOUT ANY WARRANTY; without even the implied warranty of         */
015    /*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the           */
016    /*  GNU General Public License for more details.                           */
017    /*                                                                         */
018    /*  You should have received a copy of the GNU General Public License      */
019    /*  along with this program. If not, see <http://www.gnu.org/licenses/>.   */
020    /***************************************************************************/
021    
022    package eu.lod2.nlp2rdf.schema.tools;
023    
024    import java.util.ArrayList;
025    import java.util.List;
026    
027    import com.hp.hpl.jena.ontology.*;
028    import com.hp.hpl.jena.rdf.model.*;
029    
030    /**
031     * A vocabulary for all properties, classes etc. used
032     * in the ontology. This is based on the jena schemagen
033     * output
034     *
035     * Note, that the current implementation assumes unique names
036     * for class names.
037     */
038    public class Vocabulary {
039            public static final List<java.lang.String> NAMESPACES;
040    
041            public static final Resource NSP3;
042            public static final Resource NSSTR;
043            public static final Resource NSP1;
044            public static final Resource NSERROR;
045            public static final Resource NSSSO;
046            public static final Resource NSP2;
047            public static final Resource NSP5;
048            public static final Resource NSP4;
049            public static final Resource NSTOPIC;
050            public static final Resource NSSCMS;
051            public static final Resource NSXML;
052    
053            public static final OntClass Thing;
054            public static final OntClass StopWord;
055            public static final OntClass Error;
056            public static final OntClass Word;
057            public static final OntClass Phrase;
058            public static final OntClass OffsetBasedString;
059            public static final OntClass Document;
060            public static final OntClass Sentence;
061            public static final OntClass String;
062            public static final OntClass Topic;
063            public static final OntClass ContextHashBasedString;
064    
065            public static final ObjectProperty parent;
066            public static final ObjectProperty word;
067            public static final DatatypeProperty rightContext;
068            public static final ObjectProperty nextSentenceTrans;
069            public static final ObjectProperty superString;
070            public static final ObjectProperty topic;
071            public static final ObjectProperty previousSentence;
072            public static final DatatypeProperty leftContext;
073            public static final ObjectProperty nextWord;
074            public static final ObjectProperty subString;
075            public static final DatatypeProperty endIndex;
076            public static final DatatypeProperty fatal;
077            public static final DatatypeProperty source;
078            public static final DatatypeProperty stem;
079            public static final DatatypeProperty anchorOf;
080            public static final ObjectProperty nextWordTrans;
081            public static final ObjectProperty previousWordTrans;
082            public static final ObjectProperty firstWord;
083            public static final ObjectProperty subStringTrans;
084            public static final ObjectProperty superStringTrans;
085            public static final DatatypeProperty posTag;
086            public static final ObjectProperty nextSentence;
087            public static final DatatypeProperty lemma;
088            public static final ObjectProperty child;
089            public static final ObjectProperty occursIn;
090            public static final DatatypeProperty characterticLemma;
091            public static final ObjectProperty oliaLink;
092            public static final DatatypeProperty beginIndex;
093            public static final ObjectProperty lastWord;
094            public static final ObjectProperty previousSentenceTrans;
095            public static final ObjectProperty sentence;
096            public static final DatatypeProperty message;
097            public static final ObjectProperty means;
098            public static final DatatypeProperty sourceString;
099            public static final ObjectProperty previousWord;
100            public static final ObjectProperty dominatingTopic;
101            public static final ObjectProperty sourceUrl;
102    
103            static {
104                    NAMESPACES = new ArrayList<java.lang.String>();
105                    NAMESPACES.add("file:/home/sebastian/svn/idea/nlp2rdf/ontologies/string/string-v1.0.ttl#");
106                    NAMESPACES.add("http://nlp2rdf.lod2.eu/schema/string/");
107                    NAMESPACES.add("http://nlp2rdf.lod2.eu/schema/string/#");
108                    NAMESPACES.add("http://nlp2rdf.lod2.eu/schema/error/");
109                    NAMESPACES.add("http://nlp2rdf.lod2.eu/schema/sso/");
110                    NAMESPACES.add("file:/home/sebastian/svn/idea/nlp2rdf/ontologies/sso/sso-v1.0.ttl#");
111                    NAMESPACES.add("file:/home/sebastian/svn/idea/nlp2rdf/ontologies/error/error-v0.1.ttl#");
112                    NAMESPACES.add("file:/home/sebastian/svn/idea/nlp2rdf/ontologies/topic/topic-v0.8.ttl#");
113                    NAMESPACES.add("http://nlp2rdf.lod2.eu/schema/topic/");
114                    NAMESPACES.add("http://ns.aksw.org/scms/");
115                    NAMESPACES.add("http://www.w3.org/XML/1998/namespace");
116    
117                    OntModel resourceModel = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM, null);
118    
119                    NSP3 = resourceModel.createResource("file:/home/sebastian/svn/idea/nlp2rdf/ontologies/string/string-v1.0.ttl#");
120                    NSSTR = resourceModel.createResource("http://nlp2rdf.lod2.eu/schema/string/");
121                    NSP1 = resourceModel.createResource("http://nlp2rdf.lod2.eu/schema/string/#");
122                    NSERROR = resourceModel.createResource("http://nlp2rdf.lod2.eu/schema/error/");
123                    NSSSO = resourceModel.createResource("http://nlp2rdf.lod2.eu/schema/sso/");
124                    NSP2 = resourceModel.createResource("file:/home/sebastian/svn/idea/nlp2rdf/ontologies/sso/sso-v1.0.ttl#");
125                    NSP5 = resourceModel.createResource("file:/home/sebastian/svn/idea/nlp2rdf/ontologies/error/error-v0.1.ttl#");
126                    NSP4 = resourceModel.createResource("file:/home/sebastian/svn/idea/nlp2rdf/ontologies/topic/topic-v0.8.ttl#");
127                    NSTOPIC = resourceModel.createResource("http://nlp2rdf.lod2.eu/schema/topic/");
128                    NSSCMS = resourceModel.createResource("http://ns.aksw.org/scms/");
129                    NSXML = resourceModel.createResource("http://www.w3.org/XML/1998/namespace");
130    
131                    Thing = resourceModel.createClass("http://www.w3.org/2002/07/owl#Thing");
132                    StopWord = resourceModel.createClass("http://nlp2rdf.lod2.eu/schema/sso/StopWord");
133                    Error = resourceModel.createClass("http://nlp2rdf.lod2.eu/schema/error/Error");
134                    Word = resourceModel.createClass("http://nlp2rdf.lod2.eu/schema/sso/Word");
135                    Phrase = resourceModel.createClass("http://nlp2rdf.lod2.eu/schema/sso/Phrase");
136                    OffsetBasedString = resourceModel.createClass("http://nlp2rdf.lod2.eu/schema/string/OffsetBasedString");
137                    Document = resourceModel.createClass("http://nlp2rdf.lod2.eu/schema/string/Document");
138                    Sentence = resourceModel.createClass("http://nlp2rdf.lod2.eu/schema/sso/Sentence");
139                    String = resourceModel.createClass("http://nlp2rdf.lod2.eu/schema/string/String");
140                    Topic = resourceModel.createClass("http://nlp2rdf.lod2.eu/schema/topic/Topic");
141                    ContextHashBasedString = resourceModel.createClass("http://nlp2rdf.lod2.eu/schema/string/ContextHashBasedString");
142    
143                    parent = resourceModel.createObjectProperty("http://nlp2rdf.lod2.eu/schema/sso/parent");
144                    word = resourceModel.createObjectProperty("http://nlp2rdf.lod2.eu/schema/sso/word");
145                    rightContext = resourceModel.createDatatypeProperty("http://nlp2rdf.lod2.eu/schema/string/rightContext");
146                    nextSentenceTrans = resourceModel.createObjectProperty("http://nlp2rdf.lod2.eu/schema/sso/nextSentenceTrans");
147                    superString = resourceModel.createObjectProperty("http://nlp2rdf.lod2.eu/schema/string/superString");
148                    topic = resourceModel.createObjectProperty("http://nlp2rdf.lod2.eu/schema/topic/hasTopic");
149                    previousSentence = resourceModel.createObjectProperty("http://nlp2rdf.lod2.eu/schema/sso/previousSentence");
150                    leftContext = resourceModel.createDatatypeProperty("http://nlp2rdf.lod2.eu/schema/string/leftContext");
151                    nextWord = resourceModel.createObjectProperty("http://nlp2rdf.lod2.eu/schema/sso/nextWord");
152                    subString = resourceModel.createObjectProperty("http://nlp2rdf.lod2.eu/schema/string/subString");
153                    endIndex = resourceModel.createDatatypeProperty("http://nlp2rdf.lod2.eu/schema/string/endIndex");
154                    fatal = resourceModel.createDatatypeProperty("http://nlp2rdf.lod2.eu/schema/error/fatal");
155                    source = resourceModel.createDatatypeProperty("http://nlp2rdf.lod2.eu/schema/error/source");
156                    stem = resourceModel.createDatatypeProperty("http://nlp2rdf.lod2.eu/schema/sso/stem");
157                    anchorOf = resourceModel.createDatatypeProperty("http://nlp2rdf.lod2.eu/schema/string/anchorOf");
158                    nextWordTrans = resourceModel.createObjectProperty("http://nlp2rdf.lod2.eu/schema/sso/nextWordTrans");
159                    previousWordTrans = resourceModel.createObjectProperty("http://nlp2rdf.lod2.eu/schema/sso/previousWordTrans");
160                    firstWord = resourceModel.createObjectProperty("http://nlp2rdf.lod2.eu/schema/sso/firstWord");
161                    subStringTrans = resourceModel.createObjectProperty("http://nlp2rdf.lod2.eu/schema/string/subStringTrans");
162                    superStringTrans = resourceModel.createObjectProperty("http://nlp2rdf.lod2.eu/schema/string/superStringTrans");
163                    posTag = resourceModel.createDatatypeProperty("http://nlp2rdf.lod2.eu/schema/sso/posTag");
164                    nextSentence = resourceModel.createObjectProperty("http://nlp2rdf.lod2.eu/schema/sso/nextSentence");
165                    lemma = resourceModel.createDatatypeProperty("http://nlp2rdf.lod2.eu/schema/sso/lemma");
166                    child = resourceModel.createObjectProperty("http://nlp2rdf.lod2.eu/schema/sso/child");
167                    occursIn = resourceModel.createObjectProperty("http://nlp2rdf.lod2.eu/schema/topic/occursIn");
168                    characterticLemma = resourceModel.createDatatypeProperty("http://nlp2rdf.lod2.eu/schema/topic/characteristicLemma");
169                    oliaLink = resourceModel.createObjectProperty("http://nlp2rdf.lod2.eu/schema/sso/oliaLink");
170                    beginIndex = resourceModel.createDatatypeProperty("http://nlp2rdf.lod2.eu/schema/string/beginIndex");
171                    lastWord = resourceModel.createObjectProperty("http://nlp2rdf.lod2.eu/schema/sso/lastWord");
172                    previousSentenceTrans = resourceModel.createObjectProperty("http://nlp2rdf.lod2.eu/schema/sso/previousSentenceTrans");
173                    sentence = resourceModel.createObjectProperty("http://nlp2rdf.lod2.eu/schema/sso/sentence");
174                    message = resourceModel.createDatatypeProperty("http://nlp2rdf.lod2.eu/schema/error/hasMessage");
175                    means = resourceModel.createObjectProperty("http://ns.aksw.org/scms/means");
176                    sourceString = resourceModel.createDatatypeProperty("http://nlp2rdf.lod2.eu/schema/string/sourceString");
177                    previousWord = resourceModel.createObjectProperty("http://nlp2rdf.lod2.eu/schema/sso/previousWord");
178                    dominatingTopic = resourceModel.createObjectProperty("http://nlp2rdf.lod2.eu/schema/topic/dominatingTopic");
179                    sourceUrl = resourceModel.createObjectProperty("http://nlp2rdf.lod2.eu/schema/string/sourceUrl");
180            }
181    }