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.str;
023
024 import java.util.ArrayList;
025 import java.util.List;
026 import java.util.Iterator;
027
028 import nl.tudelft.tbm.eeni.owl2java.model.jenautils.NullFilter;
029
030 import org.apache.commons.logging.Log;
031 import org.apache.commons.logging.LogFactory;
032
033 import com.hp.hpl.jena.enhanced.BuiltinPersonalities;
034 import com.hp.hpl.jena.enhanced.EnhGraph;
035 import com.hp.hpl.jena.enhanced.EnhNode;
036 import com.hp.hpl.jena.enhanced.Implementation;
037 import com.hp.hpl.jena.graph.Graph;
038 import com.hp.hpl.jena.graph.Node;
039 import com.hp.hpl.jena.ontology.Individual;
040 import com.hp.hpl.jena.ontology.OntClass;
041 import com.hp.hpl.jena.ontology.OntModel;
042 import com.hp.hpl.jena.ontology.Profile;
043 import com.hp.hpl.jena.ontology.impl.IndividualImpl;
044 import com.hp.hpl.jena.rdf.model.Resource;
045 import com.hp.hpl.jena.rdf.model.RDFNode;
046 import com.hp.hpl.jena.rdf.model.Statement;
047 import com.hp.hpl.jena.rdf.model.Literal;
048 import com.hp.hpl.jena.util.iterator.WrappedIterator;
049 import com.hp.hpl.jena.util.iterator.ExtendedIterator;
050 import com.hp.hpl.jena.util.iterator.Filter;
051 import com.hp.hpl.jena.util.iterator.Map1;
052
053 // import interface
054 import eu.lod2.nlp2rdf.schema.str.IOffsetBasedString;
055
056 /**
057 * Class http://nlp2rdf.lod2.eu/schema/string/OffsetBasedString
058 */
059 public class OffsetBasedString extends IndividualImpl implements IOffsetBasedString {
060
061 private static Log log = LogFactory.getLog(OffsetBasedString.class);
062
063 /**
064 * Implementation factory for OffsetBasedString
065 */
066 static final public Implementation factory = new Implementation() {
067
068 /**
069 * Convert a Node into an instance of the class
070 */
071 public EnhNode wrap(Node n, EnhGraph eg) {
072 if (canWrap(n, eg)) {
073 return new OffsetBasedString(n, eg);
074 } else {
075 log.warn("Cannot convert node " + n.toString() + " to OffsetBasedString");
076 return null;
077 }
078 }
079
080 /**
081 * Return true iff the node can be converted to an instance of
082 * this class (OffsetBasedString)
083 */
084 public boolean canWrap(Node n, EnhGraph eg) {
085 Profile profile;
086 if (eg instanceof OntModel)
087 profile = ((OntModel) eg).getProfile();
088 else
089 return false;
090
091 if (!profile.isSupported(n, eg, Individual.class)) {
092 return false;
093 }
094
095 Graph graph = eg.asGraph();
096 return graph.contains(n, com.hp.hpl.jena.vocabulary.RDF.type.asNode(), eu.lod2.nlp2rdf.schema.tools.Vocabulary.OffsetBasedString.asNode());
097 }
098 };
099
100 /**
101 * Filtering support for OffsetBasedString
102 */
103 static final public Filter<OffsetBasedString> nullFilter = new NullFilter<OffsetBasedString>();
104
105 /**
106 * Mapping support for OffsetBasedString
107 */
108 public static <From> Map1<From, OffsetBasedString> mapperFrom(Class<From> from) {
109 return new Map1<From, OffsetBasedString>() {
110 @Override
111 public OffsetBasedString map1(Object x) {
112 if (x instanceof Statement) {
113 Resource r = ((Statement) x).getResource();
114 if (r.canAs(OffsetBasedString.class))
115 return r.as(OffsetBasedString.class);
116 } else if (x instanceof RDFNode) {
117 if (((RDFNode) x).canAs(OffsetBasedString.class))
118 return ((RDFNode) x).as(OffsetBasedString.class);
119 }
120 return null;
121 }
122 };
123 }
124
125 // Instantiate some mappers for general use
126 static final public Map1<Statement, OffsetBasedString> statementMapper = mapperFrom(Statement.class);
127 static final public Map1<Individual, OffsetBasedString> individualMapper = mapperFrom(Individual.class);
128 static final public Map1<RDFNode, OffsetBasedString> nodeMapper = mapperFrom(RDFNode.class);
129
130 /**
131 * Generic functions from parent class
132 */
133 public OffsetBasedString(Node n, EnhGraph g) {
134 super(n, g);
135 }
136
137 /**
138 * Registers all custom classes with jena
139 */
140 public static void register() {
141 log.debug("Registering custom class OffsetBasedString with jena");
142 BuiltinPersonalities.model.add(OffsetBasedString.class, OffsetBasedString.factory);
143 BuiltinPersonalities.model.add(eu.lod2.nlp2rdf.schema.str.OffsetBasedString.class, OffsetBasedString.factory);
144 }
145
146 /**
147 * Static Functions for instance handling
148 */
149 public static OffsetBasedString get(java.lang.String uri, OntModel ontModel) {
150 Individual individual = ontModel.getIndividual(uri);
151 return (eu.lod2.nlp2rdf.schema.str.OffsetBasedString) individual.as(eu.lod2.nlp2rdf.schema.str.OffsetBasedString.class);
152 }
153
154 public static OffsetBasedString get(java.lang.String uri) {
155 return get(uri, eu.lod2.nlp2rdf.schema.tools.Factory.getDefaultModel());
156 }
157
158 public static Iterator<OffsetBasedString> iterate(OntModel ontModel) {
159 ExtendedIterator<Individual> it = ontModel.listIndividuals(eu.lod2.nlp2rdf.schema.tools.Vocabulary.OffsetBasedString);
160 return it.mapWith(individualMapper).filterDrop(nullFilter);
161 }
162
163 public static Iterator<OffsetBasedString> iterate() {
164 return iterate(eu.lod2.nlp2rdf.schema.tools.Factory.getDefaultModel());
165 }
166
167 public static List<OffsetBasedString> list(OntModel ontModel) {
168 List<OffsetBasedString> list = new ArrayList<OffsetBasedString>();
169 Iterator<OffsetBasedString> it = iterate(ontModel);
170 while (it.hasNext()) {
171 OffsetBasedString cls = it.next();
172 list.add(cls);
173 }
174 return list;
175 }
176
177 public static List<OffsetBasedString> list() {
178 return list(eu.lod2.nlp2rdf.schema.tools.Factory.getDefaultModel());
179 }
180
181 public static Iterator<OffsetBasedString> iterate(boolean direct, OntModel ontModel) {
182 OntClass cls = ontModel.getOntClass("http://nlp2rdf.lod2.eu/schema/string/OffsetBasedString");
183 ExtendedIterator<? extends RDFNode> it = cls.listInstances(direct);
184 ExtendedIterator<RDFNode> nodeIt = new WrappedIterator<RDFNode>(it) {
185 };
186 return nodeIt.mapWith(nodeMapper).filterDrop(nullFilter);
187 }
188
189 public static Iterator<OffsetBasedString> iterate(boolean direct) {
190 return iterate(direct, eu.lod2.nlp2rdf.schema.tools.Factory.getDefaultModel());
191 }
192
193 public static List<OffsetBasedString> list(boolean direct, OntModel ontModel) {
194 List<OffsetBasedString> list = new ArrayList<OffsetBasedString>();
195 Iterator<OffsetBasedString> it = iterate(direct, ontModel);
196 while (it.hasNext()) {
197 OffsetBasedString cls = it.next();
198 list.add(cls);
199 }
200 return list;
201 }
202
203 public static List<OffsetBasedString> list(boolean direct) {
204 return list(direct, eu.lod2.nlp2rdf.schema.tools.Factory.getDefaultModel());
205 }
206
207 public static int count(OntModel ontModel) {
208 int count = 0;
209 Iterator<OffsetBasedString> it = iterate(ontModel);
210 while (it.hasNext()) {
211 it.next();
212 count++;
213 }
214 return count;
215 }
216
217 public static int count() {
218 return count(eu.lod2.nlp2rdf.schema.tools.Factory.getDefaultModel());
219 }
220
221 public static int count(boolean direct, OntModel ontModel) {
222 int count = 0;
223 Iterator<OffsetBasedString> it = iterate(direct, ontModel);
224 while (it.hasNext()) {
225 it.next();
226 count++;
227 }
228 return count;
229 }
230
231 public static int count(boolean direct) {
232 return count(direct, eu.lod2.nlp2rdf.schema.tools.Factory.getDefaultModel());
233 }
234
235 public static boolean exists(java.lang.String uri, OntModel ontModel) {
236 Individual individual = ontModel.getIndividual(uri);
237 if (individual != null)
238 return true;
239 return false;
240 }
241
242 public static boolean exists(java.lang.String uri) {
243 return exists(uri, eu.lod2.nlp2rdf.schema.tools.Factory.getDefaultModel());
244 }
245
246 public static OffsetBasedString create(java.lang.String uri, OntModel ontModel) {
247 return (OffsetBasedString) ontModel.createOntResource(OffsetBasedString.class, eu.lod2.nlp2rdf.schema.tools.Vocabulary.OffsetBasedString, uri);
248 }
249
250 public static OffsetBasedString create(OntModel ontModel) {
251 return create(null, ontModel);
252 }
253
254 public static OffsetBasedString create(java.lang.String uri) {
255 return create(uri, eu.lod2.nlp2rdf.schema.tools.Factory.getDefaultModel());
256 }
257
258 public static OffsetBasedString create() {
259 return create(null, eu.lod2.nlp2rdf.schema.tools.Factory.getDefaultModel());
260 }
261
262 public static void delete(java.lang.String uri, OntModel ontModel) {
263 eu.lod2.nlp2rdf.schema.tools.Factory.deleteInstance(uri, ontModel);
264 }
265
266 public static void delete(java.lang.String uri) {
267 eu.lod2.nlp2rdf.schema.tools.Factory.deleteInstance(uri);
268 }
269
270 /**
271 * Domain property superString
272 * with uri http://nlp2rdf.lod2.eu/schema/string/superString
273 */
274 public boolean existsSuperString() {
275 return hasProperty(eu.lod2.nlp2rdf.schema.tools.Vocabulary.superString);
276 }
277
278 public boolean hasSuperString(eu.lod2.nlp2rdf.schema.str.IString stringValue) {
279 return hasProperty(eu.lod2.nlp2rdf.schema.tools.Vocabulary.superString, stringValue);
280 }
281
282 public int countSuperString() {
283 int count = 0;
284 Iterator<eu.lod2.nlp2rdf.schema.str.String> it = iterateSuperString();
285 while (it.hasNext()) {
286 it.next();
287 count++;
288 }
289 return count;
290 }
291
292 public Iterator<eu.lod2.nlp2rdf.schema.str.String> iterateSuperString() {
293 ExtendedIterator<Statement> it = listProperties(eu.lod2.nlp2rdf.schema.tools.Vocabulary.superString);
294 return it.mapWith(eu.lod2.nlp2rdf.schema.str.String.statementMapper).filterDrop(eu.lod2.nlp2rdf.schema.str.String.nullFilter);
295 }
296
297 public List<eu.lod2.nlp2rdf.schema.str.String> listSuperString() {
298 List<eu.lod2.nlp2rdf.schema.str.String> list = new ArrayList<eu.lod2.nlp2rdf.schema.str.String>();
299 Iterator<eu.lod2.nlp2rdf.schema.str.String> it = iterateSuperString();
300 while (it.hasNext()) {
301 eu.lod2.nlp2rdf.schema.str.String inst = it.next();
302 list.add(inst);
303 }
304 return list;
305 }
306
307 public void addSuperString(eu.lod2.nlp2rdf.schema.str.IString stringValue) {
308 addProperty(eu.lod2.nlp2rdf.schema.tools.Vocabulary.superString, stringValue);
309 }
310
311 public void addAllSuperString(List<? extends eu.lod2.nlp2rdf.schema.str.IString> stringList) {
312 for (eu.lod2.nlp2rdf.schema.str.IString o : stringList)
313 addSuperString(o);
314
315 }
316
317 public void removeSuperString(eu.lod2.nlp2rdf.schema.str.IString stringValue) {
318 removeProperty(eu.lod2.nlp2rdf.schema.tools.Vocabulary.superString, stringValue);
319 }
320
321 public void removeAllSuperString() {
322 removeAll(eu.lod2.nlp2rdf.schema.tools.Vocabulary.superString);
323 }
324
325 /**
326 * Domain property subString
327 * with uri http://nlp2rdf.lod2.eu/schema/string/subString
328 */
329 public boolean existsSubString() {
330 return hasProperty(eu.lod2.nlp2rdf.schema.tools.Vocabulary.subString);
331 }
332
333 public boolean hasSubString(eu.lod2.nlp2rdf.schema.str.IString stringValue) {
334 return hasProperty(eu.lod2.nlp2rdf.schema.tools.Vocabulary.subString, stringValue);
335 }
336
337 public int countSubString() {
338 int count = 0;
339 Iterator<eu.lod2.nlp2rdf.schema.str.String> it = iterateSubString();
340 while (it.hasNext()) {
341 it.next();
342 count++;
343 }
344 return count;
345 }
346
347 public Iterator<eu.lod2.nlp2rdf.schema.str.String> iterateSubString() {
348 ExtendedIterator<Statement> it = listProperties(eu.lod2.nlp2rdf.schema.tools.Vocabulary.subString);
349 return it.mapWith(eu.lod2.nlp2rdf.schema.str.String.statementMapper).filterDrop(eu.lod2.nlp2rdf.schema.str.String.nullFilter);
350 }
351
352 public List<eu.lod2.nlp2rdf.schema.str.String> listSubString() {
353 List<eu.lod2.nlp2rdf.schema.str.String> list = new ArrayList<eu.lod2.nlp2rdf.schema.str.String>();
354 Iterator<eu.lod2.nlp2rdf.schema.str.String> it = iterateSubString();
355 while (it.hasNext()) {
356 eu.lod2.nlp2rdf.schema.str.String inst = it.next();
357 list.add(inst);
358 }
359 return list;
360 }
361
362 public void addSubString(eu.lod2.nlp2rdf.schema.str.IString stringValue) {
363 addProperty(eu.lod2.nlp2rdf.schema.tools.Vocabulary.subString, stringValue);
364 }
365
366 public void addAllSubString(List<? extends eu.lod2.nlp2rdf.schema.str.IString> stringList) {
367 for (eu.lod2.nlp2rdf.schema.str.IString o : stringList)
368 addSubString(o);
369
370 }
371
372 public void removeSubString(eu.lod2.nlp2rdf.schema.str.IString stringValue) {
373 removeProperty(eu.lod2.nlp2rdf.schema.tools.Vocabulary.subString, stringValue);
374 }
375
376 public void removeAllSubString() {
377 removeAll(eu.lod2.nlp2rdf.schema.tools.Vocabulary.subString);
378 }
379
380 /**
381 * Domain property superStringTrans
382 * with uri http://nlp2rdf.lod2.eu/schema/string/superStringTrans
383 */
384 public boolean existsSuperStringTrans() {
385 return hasProperty(eu.lod2.nlp2rdf.schema.tools.Vocabulary.superStringTrans);
386 }
387
388 public boolean hasSuperStringTrans(eu.lod2.nlp2rdf.schema.str.IString stringValue) {
389 return hasProperty(eu.lod2.nlp2rdf.schema.tools.Vocabulary.superStringTrans, stringValue);
390 }
391
392 public int countSuperStringTrans() {
393 int count = 0;
394 Iterator<eu.lod2.nlp2rdf.schema.str.String> it = iterateSuperStringTrans();
395 while (it.hasNext()) {
396 it.next();
397 count++;
398 }
399 return count;
400 }
401
402 public Iterator<eu.lod2.nlp2rdf.schema.str.String> iterateSuperStringTrans() {
403 ExtendedIterator<Statement> it = listProperties(eu.lod2.nlp2rdf.schema.tools.Vocabulary.superStringTrans);
404 return it.mapWith(eu.lod2.nlp2rdf.schema.str.String.statementMapper).filterDrop(eu.lod2.nlp2rdf.schema.str.String.nullFilter);
405 }
406
407 public List<eu.lod2.nlp2rdf.schema.str.String> listSuperStringTrans() {
408 List<eu.lod2.nlp2rdf.schema.str.String> list = new ArrayList<eu.lod2.nlp2rdf.schema.str.String>();
409 Iterator<eu.lod2.nlp2rdf.schema.str.String> it = iterateSuperStringTrans();
410 while (it.hasNext()) {
411 eu.lod2.nlp2rdf.schema.str.String inst = it.next();
412 list.add(inst);
413 }
414 return list;
415 }
416
417 public void addSuperStringTrans(eu.lod2.nlp2rdf.schema.str.IString stringValue) {
418 addProperty(eu.lod2.nlp2rdf.schema.tools.Vocabulary.superStringTrans, stringValue);
419 }
420
421 public void addAllSuperStringTrans(List<? extends eu.lod2.nlp2rdf.schema.str.IString> stringList) {
422 for (eu.lod2.nlp2rdf.schema.str.IString o : stringList)
423 addSuperStringTrans(o);
424
425 }
426
427 public void removeSuperStringTrans(eu.lod2.nlp2rdf.schema.str.IString stringValue) {
428 removeProperty(eu.lod2.nlp2rdf.schema.tools.Vocabulary.superStringTrans, stringValue);
429 }
430
431 public void removeAllSuperStringTrans() {
432 removeAll(eu.lod2.nlp2rdf.schema.tools.Vocabulary.superStringTrans);
433 }
434
435 /**
436 * Domain property subStringTrans
437 * with uri http://nlp2rdf.lod2.eu/schema/string/subStringTrans
438 */
439 public boolean existsSubStringTrans() {
440 return hasProperty(eu.lod2.nlp2rdf.schema.tools.Vocabulary.subStringTrans);
441 }
442
443 public boolean hasSubStringTrans(eu.lod2.nlp2rdf.schema.str.IString stringValue) {
444 return hasProperty(eu.lod2.nlp2rdf.schema.tools.Vocabulary.subStringTrans, stringValue);
445 }
446
447 public int countSubStringTrans() {
448 int count = 0;
449 Iterator<eu.lod2.nlp2rdf.schema.str.String> it = iterateSubStringTrans();
450 while (it.hasNext()) {
451 it.next();
452 count++;
453 }
454 return count;
455 }
456
457 public Iterator<eu.lod2.nlp2rdf.schema.str.String> iterateSubStringTrans() {
458 ExtendedIterator<Statement> it = listProperties(eu.lod2.nlp2rdf.schema.tools.Vocabulary.subStringTrans);
459 return it.mapWith(eu.lod2.nlp2rdf.schema.str.String.statementMapper).filterDrop(eu.lod2.nlp2rdf.schema.str.String.nullFilter);
460 }
461
462 public List<eu.lod2.nlp2rdf.schema.str.String> listSubStringTrans() {
463 List<eu.lod2.nlp2rdf.schema.str.String> list = new ArrayList<eu.lod2.nlp2rdf.schema.str.String>();
464 Iterator<eu.lod2.nlp2rdf.schema.str.String> it = iterateSubStringTrans();
465 while (it.hasNext()) {
466 eu.lod2.nlp2rdf.schema.str.String inst = it.next();
467 list.add(inst);
468 }
469 return list;
470 }
471
472 public void addSubStringTrans(eu.lod2.nlp2rdf.schema.str.IString stringValue) {
473 addProperty(eu.lod2.nlp2rdf.schema.tools.Vocabulary.subStringTrans, stringValue);
474 }
475
476 public void addAllSubStringTrans(List<? extends eu.lod2.nlp2rdf.schema.str.IString> stringList) {
477 for (eu.lod2.nlp2rdf.schema.str.IString o : stringList)
478 addSubStringTrans(o);
479
480 }
481
482 public void removeSubStringTrans(eu.lod2.nlp2rdf.schema.str.IString stringValue) {
483 removeProperty(eu.lod2.nlp2rdf.schema.tools.Vocabulary.subStringTrans, stringValue);
484 }
485
486 public void removeAllSubStringTrans() {
487 removeAll(eu.lod2.nlp2rdf.schema.tools.Vocabulary.subStringTrans);
488 }
489
490 /**
491 * Domain property anchorOf
492 * with uri http://nlp2rdf.lod2.eu/schema/string/anchorOf
493 */
494 public boolean existsAnchorOf() {
495 return hasProperty(eu.lod2.nlp2rdf.schema.tools.Vocabulary.anchorOf);
496 }
497
498 public boolean hasAnchorOf(java.lang.String stringValue) {
499 return hasProperty(eu.lod2.nlp2rdf.schema.tools.Vocabulary.anchorOf);
500 }
501
502 public java.lang.String getAnchorOf() {
503 RDFNode n = getPropertyValue(eu.lod2.nlp2rdf.schema.tools.Vocabulary.anchorOf);
504 if (n instanceof Literal) {
505 Literal l = (Literal) n;
506 return (java.lang.String) (nl.tudelft.tbm.eeni.owl2java.model.xsd.XsdUtils.getString(l));
507 } else {
508 log.warn("Could not convert anchorOf of " + getURI() + " (" + n + ") to type String");
509 return null;
510 }
511 }
512
513 public void setAnchorOf(java.lang.String stringValue) {
514 removeAll(eu.lod2.nlp2rdf.schema.tools.Vocabulary.anchorOf);
515 nl.tudelft.tbm.eeni.owl2java.model.xsd.XsdUtils.createTypedLiteral((OntModel) getModel(), stringValue, "http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral");
516 Literal literal = nl.tudelft.tbm.eeni.owl2java.model.xsd.XsdUtils.createTypedLiteral((OntModel) getModel(), stringValue, "http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral");
517 setPropertyValue(eu.lod2.nlp2rdf.schema.tools.Vocabulary.anchorOf, literal);
518 }
519
520 public void removeAnchorOf() {
521 removeAll(eu.lod2.nlp2rdf.schema.tools.Vocabulary.anchorOf);
522 }
523
524 /**
525 * Domain property endIndex
526 * with uri http://nlp2rdf.lod2.eu/schema/string/endIndex
527 */
528 public boolean existsEndIndex() {
529 return hasProperty(eu.lod2.nlp2rdf.schema.tools.Vocabulary.endIndex);
530 }
531
532 public boolean hasEndIndex(java.lang.String stringValue) {
533 return hasProperty(eu.lod2.nlp2rdf.schema.tools.Vocabulary.endIndex);
534 }
535
536 public int countEndIndex() {
537 int count = 0;
538 Iterator<java.lang.String> it = iterateEndIndex();
539 while (it.hasNext()) {
540 it.next();
541 count++;
542 }
543 return count;
544 }
545
546 public Iterator<java.lang.String> iterateEndIndex() {
547 ExtendedIterator<Statement> it = listProperties(eu.lod2.nlp2rdf.schema.tools.Vocabulary.endIndex);
548 return it.mapWith(nl.tudelft.tbm.eeni.owl2java.model.xsd.XsdUtils.objectAsStringMapper).filterDrop(new NullFilter<java.lang.String>());
549 }
550
551 public List<java.lang.String> listEndIndex() {
552 List<java.lang.String> list = new ArrayList<java.lang.String>();
553 Iterator<java.lang.String> it = iterateEndIndex();
554 while (it.hasNext()) {
555 java.lang.String inst = it.next();
556 list.add(inst);
557 }
558 return list;
559 }
560
561 public void addEndIndex(java.lang.String stringValue) {
562 Literal literal = nl.tudelft.tbm.eeni.owl2java.model.xsd.XsdUtils.createTypedLiteral((OntModel) getModel(), stringValue, "http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral");
563 setPropertyValue(eu.lod2.nlp2rdf.schema.tools.Vocabulary.endIndex, literal);
564 }
565
566 public void addAllEndIndex(List<java.lang.String> stringList) {
567 for (java.lang.String o : stringList)
568 addEndIndex(o);
569 }
570
571 public void removeEndIndex(java.lang.String stringValue) {
572 Literal literal = nl.tudelft.tbm.eeni.owl2java.model.xsd.XsdUtils.createTypedLiteral((OntModel) getModel(), stringValue, "http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral");
573 removeProperty(eu.lod2.nlp2rdf.schema.tools.Vocabulary.endIndex, literal);
574 }
575
576 public void removeAllEndIndex() {
577 removeAll(eu.lod2.nlp2rdf.schema.tools.Vocabulary.endIndex);
578
579 }
580
581 /**
582 * Domain property beginIndex
583 * with uri http://nlp2rdf.lod2.eu/schema/string/beginIndex
584 */
585 public boolean existsBeginIndex() {
586 return hasProperty(eu.lod2.nlp2rdf.schema.tools.Vocabulary.beginIndex);
587 }
588
589 public boolean hasBeginIndex(java.lang.String stringValue) {
590 return hasProperty(eu.lod2.nlp2rdf.schema.tools.Vocabulary.beginIndex);
591 }
592
593 public int countBeginIndex() {
594 int count = 0;
595 Iterator<java.lang.String> it = iterateBeginIndex();
596 while (it.hasNext()) {
597 it.next();
598 count++;
599 }
600 return count;
601 }
602
603 public Iterator<java.lang.String> iterateBeginIndex() {
604 ExtendedIterator<Statement> it = listProperties(eu.lod2.nlp2rdf.schema.tools.Vocabulary.beginIndex);
605 return it.mapWith(nl.tudelft.tbm.eeni.owl2java.model.xsd.XsdUtils.objectAsStringMapper).filterDrop(new NullFilter<java.lang.String>());
606 }
607
608 public List<java.lang.String> listBeginIndex() {
609 List<java.lang.String> list = new ArrayList<java.lang.String>();
610 Iterator<java.lang.String> it = iterateBeginIndex();
611 while (it.hasNext()) {
612 java.lang.String inst = it.next();
613 list.add(inst);
614 }
615 return list;
616 }
617
618 public void addBeginIndex(java.lang.String stringValue) {
619 Literal literal = nl.tudelft.tbm.eeni.owl2java.model.xsd.XsdUtils.createTypedLiteral((OntModel) getModel(), stringValue, "http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral");
620 setPropertyValue(eu.lod2.nlp2rdf.schema.tools.Vocabulary.beginIndex, literal);
621 }
622
623 public void addAllBeginIndex(List<java.lang.String> stringList) {
624 for (java.lang.String o : stringList)
625 addBeginIndex(o);
626 }
627
628 public void removeBeginIndex(java.lang.String stringValue) {
629 Literal literal = nl.tudelft.tbm.eeni.owl2java.model.xsd.XsdUtils.createTypedLiteral((OntModel) getModel(), stringValue, "http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral");
630 removeProperty(eu.lod2.nlp2rdf.schema.tools.Vocabulary.beginIndex, literal);
631 }
632
633 public void removeAllBeginIndex() {
634 removeAll(eu.lod2.nlp2rdf.schema.tools.Vocabulary.beginIndex);
635
636 }
637
638 /**
639 * Domain property rightContext
640 * with uri http://nlp2rdf.lod2.eu/schema/string/rightContext
641 */
642 public boolean existsRightContext() {
643 return hasProperty(eu.lod2.nlp2rdf.schema.tools.Vocabulary.rightContext);
644 }
645
646 public boolean hasRightContext(java.lang.String stringValue) {
647 return hasProperty(eu.lod2.nlp2rdf.schema.tools.Vocabulary.rightContext);
648 }
649
650 public int countRightContext() {
651 int count = 0;
652 Iterator<java.lang.String> it = iterateRightContext();
653 while (it.hasNext()) {
654 it.next();
655 count++;
656 }
657 return count;
658 }
659
660 public Iterator<java.lang.String> iterateRightContext() {
661 ExtendedIterator<Statement> it = listProperties(eu.lod2.nlp2rdf.schema.tools.Vocabulary.rightContext);
662 return it.mapWith(nl.tudelft.tbm.eeni.owl2java.model.xsd.XsdUtils.objectAsStringMapper).filterDrop(new NullFilter<java.lang.String>());
663 }
664
665 public List<java.lang.String> listRightContext() {
666 List<java.lang.String> list = new ArrayList<java.lang.String>();
667 Iterator<java.lang.String> it = iterateRightContext();
668 while (it.hasNext()) {
669 java.lang.String inst = it.next();
670 list.add(inst);
671 }
672 return list;
673 }
674
675 public void addRightContext(java.lang.String stringValue) {
676 Literal literal = nl.tudelft.tbm.eeni.owl2java.model.xsd.XsdUtils.createTypedLiteral((OntModel) getModel(), stringValue, "http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral");
677 setPropertyValue(eu.lod2.nlp2rdf.schema.tools.Vocabulary.rightContext, literal);
678 }
679
680 public void addAllRightContext(List<java.lang.String> stringList) {
681 for (java.lang.String o : stringList)
682 addRightContext(o);
683 }
684
685 public void removeRightContext(java.lang.String stringValue) {
686 Literal literal = nl.tudelft.tbm.eeni.owl2java.model.xsd.XsdUtils.createTypedLiteral((OntModel) getModel(), stringValue, "http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral");
687 removeProperty(eu.lod2.nlp2rdf.schema.tools.Vocabulary.rightContext, literal);
688 }
689
690 public void removeAllRightContext() {
691 removeAll(eu.lod2.nlp2rdf.schema.tools.Vocabulary.rightContext);
692
693 }
694
695 /**
696 * Domain property leftContext
697 * with uri http://nlp2rdf.lod2.eu/schema/string/leftContext
698 */
699 public boolean existsLeftContext() {
700 return hasProperty(eu.lod2.nlp2rdf.schema.tools.Vocabulary.leftContext);
701 }
702
703 public boolean hasLeftContext(java.lang.String stringValue) {
704 return hasProperty(eu.lod2.nlp2rdf.schema.tools.Vocabulary.leftContext);
705 }
706
707 public int countLeftContext() {
708 int count = 0;
709 Iterator<java.lang.String> it = iterateLeftContext();
710 while (it.hasNext()) {
711 it.next();
712 count++;
713 }
714 return count;
715 }
716
717 public Iterator<java.lang.String> iterateLeftContext() {
718 ExtendedIterator<Statement> it = listProperties(eu.lod2.nlp2rdf.schema.tools.Vocabulary.leftContext);
719 return it.mapWith(nl.tudelft.tbm.eeni.owl2java.model.xsd.XsdUtils.objectAsStringMapper).filterDrop(new NullFilter<java.lang.String>());
720 }
721
722 public List<java.lang.String> listLeftContext() {
723 List<java.lang.String> list = new ArrayList<java.lang.String>();
724 Iterator<java.lang.String> it = iterateLeftContext();
725 while (it.hasNext()) {
726 java.lang.String inst = it.next();
727 list.add(inst);
728 }
729 return list;
730 }
731
732 public void addLeftContext(java.lang.String stringValue) {
733 Literal literal = nl.tudelft.tbm.eeni.owl2java.model.xsd.XsdUtils.createTypedLiteral((OntModel) getModel(), stringValue, "http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral");
734 setPropertyValue(eu.lod2.nlp2rdf.schema.tools.Vocabulary.leftContext, literal);
735 }
736
737 public void addAllLeftContext(List<java.lang.String> stringList) {
738 for (java.lang.String o : stringList)
739 addLeftContext(o);
740 }
741
742 public void removeLeftContext(java.lang.String stringValue) {
743 Literal literal = nl.tudelft.tbm.eeni.owl2java.model.xsd.XsdUtils.createTypedLiteral((OntModel) getModel(), stringValue, "http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral");
744 removeProperty(eu.lod2.nlp2rdf.schema.tools.Vocabulary.leftContext, literal);
745 }
746
747 public void removeAllLeftContext() {
748 removeAll(eu.lod2.nlp2rdf.schema.tools.Vocabulary.leftContext);
749
750 }
751
752 }