001: /*
002: * (c) Copyright 2000, 2001, 2002, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
003: * All rights reserved.
004: *
005: * Redistribution and use in source and binary forms, with or without
006: * modification, are permitted provided that the following conditions
007: * are met:
008: * 1. Redistributions of source code must retain the above copyright
009: * notice, this list of conditions and the following disclaimer.
010: * 2. Redistributions in binary form must reproduce the above copyright
011: * notice, this list of conditions and the following disclaimer in the
012: * documentation and/or other materials provided with the distribution.
013: * 3. The name of the author may not be used to endorse or promote products
014: * derived from this software without specific prior written permission.
015:
016: * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
017: * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
018: * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
019: * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
020: * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
021: * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
022: * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
023: * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
024: * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
025: * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
026: *
027: * ModelCon.java
028: *
029: * Created on 7 December 2001, 11:00
030: */
031:
032: package com.hp.hpl.jena.rdf.model;
033:
034: import java.util.Calendar;
035:
036: import com.hp.hpl.jena.datatypes.RDFDatatype;
037: import com.hp.hpl.jena.graph.Node;
038:
039: /** Convenience methods which extend the {@link Model} interface.
040: * <P>The {@link Model} interface provides a set of primitive operations on
041: * an RDF model. This interface extends those methods with a
042: * set of convenience methods.</P>
043: * <p>This interface provides methods supporting typed literals. This means
044: * that methods are provided which will translate a built in type, or an
045: * object to an RDF Literal. This translation is done by invoking the
046: * <CODE>toString()</CODE> method of the object, or its built in equivalent.
047: * The reverse translation is also supported. This is built in for built
048: * in types. Factory objects, provided by the application, are used
049: * for application objects.</p>
050: * <p>This interface provides methods for supporting enhanced resources. An
051: * enhanced resource is a resource to which the application has added
052: * behaviour. RDF containers are examples of enhanced resources built in
053: * to this package. Enhanced resources are supported by encapsulating a
054: * resource created by an implementation in another class which adds
055: * the extra behaviour. Factory objects are used to construct such
056: * enhanced resources.</p>
057: * @author bwm
058: * @version Release='$Name: $'
059: Revision='$Revision: 1.30 $'
060: Date='$Date: 2008/01/02 12:05:48 $'
061: */
062: public interface ModelCon {
063:
064: /** Return a Resource instance in this model.
065: *
066: * <p>Subsequent operations on the returned object may modify this model.</p>
067: * <p>The resource is assumed to already exist in the model. If it does not,
068: * <CODE>createResource</CODE> should be used instead.</p>
069: * @return a resource instance created by the factory provided
070: * @param uri the URI of the resource
071: * @param f the factory object
072:
073: */
074: Resource getResource(String uri, ResourceF f);
075:
076: /** Return a Property instance in this model.
077: *
078: * <p>Subsequent operations on the returned property may modify this model.</p>
079: * <p>The property is assumed to already exist in the model. If it does not,
080: * <CODE>createProperty</CODE> should be used instead.</p>
081: * @return a property object
082: * @param uri the URI of the property
083:
084: */
085: Property getProperty(String uri);
086:
087: /** Return a Bag instance in this model.
088: *
089: * <p>Subsequent operations on the returned bag may modify this model.</p>
090: * <p>The bag is assumed to already exist in the model. If it does not,
091: * <CODE>createBag</CODE> should be used instead.</p>
092: * @return a bag instance
093: * @param uri the URI of the bag.
094:
095: */
096: Bag getBag(String uri);
097:
098: /** Return a bag instance based on a given resource.
099: *
100: * <p> This method enables an application to treat any resource as a bag.
101: * It is in effect an unsafe downcast.</p>
102: *
103: * <p>Subsequent operations on the returned bag may modify this model.</p>
104: * <p>The bag is assumed to already exist in the model. If it does not,
105: * <CODE>createBag</CODE> should be used instead.</p>
106: * @return a bag instance
107: * @param r an untyped Resource instance
108:
109: */
110: Bag getBag(Resource r);
111:
112: /** Return an Alt instance in this model.
113: *
114: * <p>Subsequent operations on the returned object may modify this model.</p>
115: * <p>The alt is assumed to already exist in the model. If it does not,
116: * <CODE>createAlt</CODE> should be used instead.</p>
117: * @return an alt instance
118: * @param uri the URI of the alt
119:
120: */
121: Alt getAlt(String uri);
122:
123: /** Return an Alt instance based on a given resource.
124: *
125: * <p> This method enables an application to treat any resource as an Alt.
126: * It is in effect an unsafe downcast.</p>
127: *
128: * <p>Subsequent operations on the returned Alt may modify this model.</p>
129: * <p>The bag is assumed to already exist in the model. If it does not,
130: * <CODE>createAlt</CODE> should be used instead.</p>
131: * @return an Alt instance
132: * @param r an untyped Resource instance
133:
134: */
135: Alt getAlt(Resource r);
136:
137: /** Return a Seq instance in this model.
138: *
139: * <p>Subsequent operations on the returned bag may modify this model.</p>
140: * <p>The seq is assumed to already exist in the model. If it does not,
141: * <CODE>createSeq</CODE> should be used instead.</p>
142: * @return a seq instance
143: * @param uri the URI of the seq
144:
145: */
146: Seq getSeq(String uri);
147:
148: /** Return a Seq instance based on a given resource.
149: *
150: * <p> This method enables an application to treat any resource as a Seq.
151: * It is in effect an unsafe downcast.</p>
152: *
153: * <p>Subsequent operations on the returned Seq may modify this model.</p>
154: * <p>The Seq is assumed to already exist in the model. If it does not,
155: * <CODE>createAlt</CODE> should be used instead.</p>
156: * @return an Alt instance
157: * @param r an untyped Resource instance
158:
159: */
160: Seq getSeq(Resource r);
161:
162: /** Create a new anonymous resource with a given type.
163: *
164: * <p> Subsequent operations on the returned resource may modify this model.
165: * </p>
166: * <p> The resource is created and an rdf:type property added to the model
167: * to specify its type. </p>
168: * @param type the type of the resource to be created.
169: * @return a new anonymous resource linked to this model.
170: */
171: public Resource createResource(Resource type);
172:
173: /**
174: Create or find an RDFNode
175: (a {@link Resource} or a {@link Literal})
176: from a graph Node. This is provided for users and
177: developers operating at the API/SPI interface, where Resources are
178: constructed from Nodes. Providing this method allows each Model
179: the opportunity to cache node-to-resource maps if it requires.
180:
181: @param n the graph.Node on which to base the Model.RDFNode
182: @return a suitable RDFNode
183: */
184: public RDFNode getRDFNode(Node n);
185:
186: /** Create a new resource with a given type.
187: *
188: * <p> Subsequent operations on the returned resource may modify this model.
189: * </p>
190: * <p> The resource is created and an rdf:type property added to the model
191: * to specify its type. </p>
192: * @param type the type of the resource to be created.
193: * @return a new resource linked to this model.
194: * @param uri The URI of the new resource.
195: */
196: public Resource createResource(String uri, Resource type);
197:
198: /** Create a new anonymous resource using the supplied factory.
199: *
200: * <p> Subsequent operations on the returned resource may modify this model.
201: * </p>
202: * @return a new anonymous resource linked to this model.
203: * @param f A factory object to create the returned object.
204: .
205: */
206: public Resource createResource(ResourceF f);
207:
208: /** Create a new resource using the supplied factory.
209: *
210: * <p> Subsequent operations on the returned resource may modify this model.
211: * </p>
212: * @return a new resource linked to this model.
213: * @param uri the URI of the resource
214: * @param f A factory to create the returned object.
215: .
216: */
217: public Resource createResource(String uri, ResourceF f);
218:
219: /** Create a property.
220: *
221: * <p> Subsequent operations on the returned property may modify this model.
222: * </p>
223: * @param uri the URI of the property
224:
225: * @return a property instance
226: */
227: public Property createProperty(String uri);
228:
229: /** create a literal from a String value.
230: *
231: * @param v the value of the literal
232: * @return a new literal representing the value v
233: */
234: public Literal createLiteral(String v);
235:
236: /** create a type literal from a boolean value.
237: *
238: * <p> The value is converted to a string using its <CODE>toString</CODE>
239: * method. </p>
240: * @param v the value of the literal
241: * @return a new literal representing the value v
242: */
243: public Literal createTypedLiteral(boolean v);
244:
245: /** create a typed literal from an integer value.
246: *
247: * @param v the value of the literal
248: * @return a new literal representing the value v
249: */
250: public Literal createTypedLiteral(int v);
251:
252: /** create a typed literal from an integer value.
253: *
254: * @param v the value of the literal
255: * @return a new literal representing the value v
256: */
257: public Literal createTypedLiteral(long v);
258:
259: /**
260: * Create a typed literal of type xsd:dateTime from a Calendar object.
261: */
262: public Literal createTypedLiteral(Calendar d);
263:
264: /** create a typed literal from a char value.
265: *
266: * @param v the value of the literal
267: * @return a new literal representing the value v
268: */
269: public Literal createTypedLiteral(char v);
270:
271: /** create a typed literal from a float value.
272: *
273: * @param v the value of the literal
274: * @return a new literal representing the value v
275: */
276: public Literal createTypedLiteral(float v);
277:
278: /** create a typed literal from a double value.
279: *
280: * @param v the value of the literal
281: * @return a new literal representing the value v
282: */
283: public Literal createTypedLiteral(double v);
284:
285: /** create a typed literal from a String value.
286: *
287: * @param v the value of the literal
288: * @return a new literal representing the value v
289: */
290: public Literal createTypedLiteral(String v);
291:
292: /** create a literal from an Object.
293: *
294: * @return a new literal representing the value v
295: * @param v the value of the literal.
296: */
297: public Literal createTypedLiteral(Object v);
298:
299: /**
300: * Build a typed literal from its lexical form. The
301: * lexical form will be parsed now and the value stored. If
302: * the form is not legal this will throw an exception.
303: * <p>
304: * Note that in preview releases of Jena2 it was also possible to specify
305: * a language type. Changes to the RDF specification mean that this is no longer
306: * legal except for plain literals. To create a plain literal with a language tag
307: * use {@link Model#createLiteral(String, String) createLiteral}.
308: * </p>
309: *
310: * @param lex the lexical form of the literal
311: * @param typeURI the uri of the type of the literal, null for old style "plain" literals
312: * @throws DatatypeFormatException if lex is not a legal form of dtype
313: */
314: public Literal createTypedLiteral(String lex, String typeURI);
315:
316: /**
317: * Build a typed literal from its value form.
318: * <p>
319: * Note that in preview releases of Jena2 it was also possible to specify
320: * a language type. Changes to the RDF specification mean that this is no longer
321: * legal except for plain literals. To create a plain literal with a language tag
322: * use {@link Model#createLiteral(String, String) createLiteral}.
323: * </p>
324: *
325: * @param value the value of the literal
326: * @param typeURI the URI of the type of the literal, null for old style "plain" literals
327: */
328: public Literal createTypedLiteral(Object value, String typeURI);
329:
330: /**
331: Answer a new Statement object (s, p, o') where o' is the typed literal
332: corresponding to o using createTypedLiteral.
333: */
334: public Statement createLiteralStatement(Resource s, Property p,
335: boolean o);
336:
337: /**
338: Answer a new Statement object (s, p, o') where o' is the typed literal
339: corresponding to o using createTypedLiteral.
340: */
341: public Statement createLiteralStatement(Resource s, Property p,
342: float o);
343:
344: /**
345: Answer a new Statement object (s, p, o') where o' is the typed literal
346: corresponding to o using createTypedLiteral.
347: */
348: public Statement createLiteralStatement(Resource s, Property p,
349: double o);
350:
351: /**
352: Answer a new Statement object (s, p, o') where o' is the typed literal
353: corresponding to o using createTypedLiteral.
354: */
355: public Statement createLiteralStatement(Resource s, Property p,
356: long o);
357:
358: /**
359: Answer a new Statement object (s, p, o') where o' is the typed literal
360: corresponding to o using createTypedLiteral.
361: */
362: public Statement createLiteralStatement(Resource s, Property p,
363: int o);
364:
365: /**
366: Answer a new Statement object (s, p, o') where o' is the typed literal
367: corresponding to o using createTypedLiteral.
368: */
369: public Statement createLiteralStatement(Resource s, Property p,
370: char o);
371:
372: /**
373: Answer a new Statement object (s, p, o') where o' is the typed literal
374: corresponding to o using createTypedLiteral.
375: */
376: public Statement createLiteralStatement(Resource s, Property p,
377: Object o);
378:
379: /** Create a Statement instance.
380: *
381: * <p>Subsequent operations on the statement or any of its parts may
382: * modify this model.</p>
383: * <p>Creating a statement does not add it to the set of statements in the
384: * model. </p>
385: * <p>The Object o will be converted to a Literal.</P>
386: * @param s the subject of the statement
387: * @param p the predicate of the statement
388: * @param o is the value to be the object of the statement
389:
390: * @return the new statement
391: */
392: public Statement createStatement(Resource s, Property p, String o);
393:
394: /** Create a Statement instance.
395: *
396: * <p>Subsequent operations on the statement or any of its parts may
397: * modify this model.</p>
398: * <p>Creating a statement does not add it to the set of statements in the
399: * model. </p>
400: * <p>The Object o will be converted to a Literal.</P>
401: * @param s the subject of the statement
402: * @param p the predicate of the statement
403: * @param o is the value to be the object of the statement
404: * @param l the language associated with the object
405:
406: * @return the new statement
407: */
408: public Statement createStatement(Resource s, Property p, String o,
409: String l);
410:
411: /** Create a Statement instance.
412: *
413: * <p>Subsequent operations on the statement or any of its parts may
414: * modify this model.</p>
415: * <p>Creating a statement does not add it to the set of statements in the
416: * model. </p>
417: * <p>The Object o will be converted to a Literal.</P>
418: * @param s the subject of the statement
419: * @param p the predicate of the statement
420: * @param o is the value to be the object of the statement
421: * @param wellFormed true if the string is well formed XML
422:
423: * @return the new statement
424: */
425: public Statement createStatement(Resource s, Property p, String o,
426: boolean wellFormed);
427:
428: /** Create a Statement instance.
429: *
430: * <p>Subsequent operations on the statement or any of its parts may
431: * modify this model.</p>
432: * <p>Creating a statement does not add it to the set of statements in the
433: * model. </p>
434: * <p>The Object o will be converted to a Literal.</P>
435: * @param s the subject of the statement
436: * @param p the predicate of the statement
437: * @param o is the value to be the object of the statement
438: * @param l the language associated with the object
439: * @param wellFormed true of the string is well formed XML
440:
441: * @return the new statement
442: */
443: public Statement createStatement(Resource s, Property p, String o,
444: String l, boolean wellFormed);
445:
446: /** Create a new anonymous bag.
447: *
448: * <p>Subsequent operations on the bag or any of its parts may
449: * modify this model.</p>
450: * <p>A statement defining the type of the new bag is added to this model.
451: * </p>
452: * @return a new anonymous bag.
453: */
454: public Bag createBag();
455:
456: /** Create a new bag.
457: *
458: * <p>Subsequent operations on the bag or any of its parts may
459: * modify this model.</p>
460: * <p>A statement defining the type of the new bag is added to this model.
461: * </p>
462: * @param uri The URI of the new Bag.
463: * @return a new bag.
464: */
465: public Bag createBag(String uri);
466:
467: /** Create a new anonymous alt.
468: *
469: * <p>Subsequent operations on the alt or any of its parts may
470: * modify this model.</p>
471: * <p>A statement defining the type of the new alt is added to this model.
472: * </p>
473: * @return a new anonymous alt.
474: */
475: public Alt createAlt();
476:
477: /** Create a new alt.
478: *
479: * <p>Subsequent operations on the alt or any of its parts may
480: * modify this model.</p>
481: * <p>A statement defining the type of the new alt is added to this model.
482: * </p>
483: * @param uri The URI of the new alt.
484: * @return a new alt.
485: */
486: public Alt createAlt(String uri);
487:
488: /** Create a new anonymous seq.
489: *
490: * <p>Subsequent operations on the seq or any of its parts may
491: * modify this model.</p>
492: * <p>A statement defining the type of the new seq is added to this model.
493: * </p>
494: * @return a new anonymous seq.
495: */
496: public Seq createSeq();
497:
498: /** Create a new seq.
499: *
500: * <p>Subsequent operations on the seq or any of its parts may
501: * modify this model.</p>
502: * <p>A statement defining the type of the new seq is added to this model.
503: * </p>
504: * @param uri The URI of the new seq.
505: * @return a new seq.
506: */
507: public Seq createSeq(String uri);
508:
509: /** add a statement to this model.
510: * @return this model
511: * @param s the subject of the statement to add
512: * @param p the predicate of the statement to add
513: * @param o the object of the statement to add
514: */
515: Model add(Resource s, Property p, RDFNode o);
516:
517: /**
518: Add the statement (s, p, createTypedLiteral( o )) to this model and
519: answer this model.
520: */
521: Model addLiteral(Resource s, Property p, boolean o);
522:
523: /**
524: Add the statement (s, p, createTypedLiteral( o )) to this model and
525: answer this model.
526: */
527: Model addLiteral(Resource s, Property p, long o);
528:
529: /**
530: Add the statement (s, p, createTypedLiteral( o )) to this model and
531: answer this model.
532: */
533: Model addLiteral(Resource s, Property p, int o);
534:
535: /**
536: Add the statement (s, p, createTypedLiteral( o )) to this model and
537: answer this model.
538: */
539: Model addLiteral(Resource s, Property p, char o);
540:
541: /**
542: Add the statement (s, p, o') to the model, where o' is the typed
543: literal corresponding to o. Answer this model.
544: */
545: Model addLiteral(Resource s, Property p, float o);
546:
547: /**
548: Add the statement (s, p, o') to the model, where o' is the typed
549: literal corresponding to o. Answer this model.
550: */
551: Model addLiteral(Resource s, Property p, double o);
552:
553: /** add a statement to this model.
554: *
555: * @return this model
556: * @param s the subject of the statement to add
557: * @param p the predicate of the statement to add
558: * @param o the object of the statement to add
559: */
560: Model add(Resource s, Property p, String o);
561:
562: /** add a statement to this model.
563: *
564: * @return this model
565: * @param s the subject of the statement to add
566: * @param p the predicate of the statement to add
567: * @param lex the lexcial form of the literal
568: * @param datatype the datatype of the literal
569: */
570: Model add(Resource s, Property p, String lex, RDFDatatype datatype);
571:
572: /** add a statement to this model.
573: *
574: * @return this model
575: * @param s the subject of the statement to add
576: * @param p the predicate of the statement to add
577: * @param o the object of the statement to add
578: * @param wellFormed true if o is well formed XML
579: */
580: Model add(Resource s, Property p, String o, boolean wellFormed);
581:
582: /** add a statement to this model.
583: *
584: * @return this model
585: * @param s the subject of the statement to add
586: * @param p the predicate of the statement to add
587: * @param o the object of the statement to add
588: * @param l the language associated with the object
589:
590: */
591: Model add(Resource s, Property p, String o, String l);
592:
593: /**
594: * @deprecated since Jena2. It is no longer legal to have a language
595: * tag on a well-formed XMLLiteral. Use the 4-argument form of
596: * {@link #add(Resource, Property, String, boolean) add} instead.
597: *
598: * add a statement to this model.
599: *
600: * @return this model
601: * @param s the subject of the statement to add
602: * @param p the predicate of the statement to add
603: * @param o the object of the statement to add
604: * @param l the language associated with the object
605: * @param wellFormed true if o is well formed XML
606:
607: */
608: Model add(Resource s, Property p, String o, String l,
609: boolean wellFormed);
610:
611: /** add a statement to this model.
612: *
613: * @return this model
614: * @param s the subject of the statement to add
615: * @param p the predicate of the statement to add
616: * @param o the object of the statement to add
617: * deprecated Applications should use typed literals
618: */
619: Model addLiteral(Resource s, Property p, Object o);
620:
621: /**
622: remove the statement <code>(s, p, o)</code> from this model and
623: answer this model. None of <code>s, p, o</code> are permitted to
624: be <code>null</code>: for wildcard removal, see <code>removeAll</code>.
625: */
626: Model remove(Resource s, Property p, RDFNode o);
627:
628: /** Remove all the Statements returned by an iterator.
629: * @return this model
630: * @param iter the iterator which returns the statements to be removed.
631:
632: */
633: Model remove(StmtIterator iter);
634:
635: /** Remove all the Statements in a given model, including reified statements
636: * @return this model
637: * @param m the model containing the statements to be removed.
638:
639: */
640: Model remove(Model m);
641:
642: /**
643: Remove from this model all the statements found in the given model.
644: If suppressreifications is true, remove the reified statements of m as well.
645: @param m the model containing the statements to remove
646: @param suppressReifications true to remove reified statements too
647: @return this model for cascading
648: */
649: Model remove(Model m, boolean suppressReifications);
650:
651: /**
652: Answer a statement iterator that will iterate over all the statements
653: (S, P, O) in this model where S matches <code>subject</code>, P
654: matches <code>predicate</code>, and O matches the typed literal
655: corresponding to <code>object</code>.
656: */
657: StmtIterator listLiteralStatements(Resource subject,
658: Property predicate, boolean object);
659:
660: /**
661: Answer a statement iterator that will iterate over all the statements
662: (S, P, O) in this model where S matches <code>subject</code>, P
663: matches <code>predicate</code>, and O matches the typed literal
664: corresponding to <code>object</code>.
665: */
666: StmtIterator listLiteralStatements(Resource subject,
667: Property predicate, char object);
668:
669: /**
670: Answer a statement iterator that will iterate over all the statements
671: (S, P, O) in this model where S matches <code>subject</code>, P
672: matches <code>predicate</code>, and O matches the typed literal
673: corresponding to <code>object</code>.
674: */
675: StmtIterator listLiteralStatements(Resource subject,
676: Property predicate, long object);
677:
678: /**
679: Answer a statement iterator that will iterate over all the statements
680: (S, P, O) in this model where S matches <code>subject</code>, P
681: matches <code>predicate</code>, and O matches the typed literal
682: corresponding to <code>object</code>.
683: */
684: StmtIterator listlLiteralStatements(Resource subject,
685: Property predicate, float object);
686:
687: /**
688: Answer a statement iterator that will iterate over all the statements
689: (S, P, O) in this model where S matches <code>subject</code>, P
690: matches <code>predicate</code>, and O matches the typed literal
691: corresponding to <code>object</code>.
692: */
693: StmtIterator listLiteralStatements(Resource subject,
694: Property predicate, double object);
695:
696: /** Find all the statements matching a pattern.
697: * <p>Return an iterator over all the statements in a model
698: * that match a pattern. The statements selected are those
699: * whose subject matches the <code>subject</code> argument,
700: * whose predicate matches the <code>predicate</code> argument
701: * and whose object matchesthe <code>object</code> argument.</p>
702: * @return an iterator over the subjects
703: * @param subject The subject sought
704: * @param predicate The predicate sought
705: * @param object The value sought
706:
707: */
708: StmtIterator listStatements(Resource subject, Property predicate,
709: String object);
710:
711: /** Find all the statements matching a pattern.
712: * <p>Return an iterator over all the statements in a model
713: * that match a pattern. The statements selected are those
714: * whose subject matches the <code>subject</code> argument,
715: * whose predicate matches the <code>predicate</code> argument
716: * and whose object matchesthe <code>object</code> argument.
717: * If an argument is <code>null</code> it matches anything.</p>
718: * @return an iterator over the subjects
719: * @param subject The subject sought
720: * @param predicate The predicate sought
721: * @param object The value sought
722: * @param lang The lang code ofthe string.
723:
724: */
725: StmtIterator listStatements(Resource subject, Property predicate,
726: String object, String lang);
727:
728: /**
729: Answer an iterator [without duplicates] over all the resources in this
730: model which have value o' for property p, where o' is the typed literal
731: corresponding to o.
732: */
733: ResIterator listResourcesWithProperty(Property p, boolean o);
734:
735: /**
736: Answer an iterator [without duplicates] over all the resources in this
737: model which have value o' for property p, where o' is the typed literal
738: corresponding to o.
739: */
740: ResIterator listResourcesWithProperty(Property p, long o);
741:
742: /**
743: Answer an iterator [without duplicates] over all the resources in this
744: model which have value o' for property p, where o' is the typed literal
745: corresponding to o.
746: */
747: ResIterator listResourcesWithProperty(Property p, char o);
748:
749: /**
750: Answer an iterator [without duplicates] over all the resources in this
751: model which have value o' for property p, where o' is the typed literal
752: corresponding to o.
753: */
754: ResIterator listResourcesWithProperty(Property p, float o);
755:
756: /**
757: Answer an iterator [without duplicates] over all the resources in this
758: model which have value o' for property p, where o' is the typed literal
759: corresponding to o.
760: */
761: ResIterator listResourcesWithProperty(Property p, double o);
762:
763: /**
764: Answer an iterator [without duplicates] over all the resources in this
765: model which have value o' for property p, where o' is the typed literal
766: corresponding to o.
767: */
768: ResIterator listResourcesWithProperty(Property p, Object o);
769:
770: /** lists all subjects with a given property and property value.
771: * @return an iterator over the set of subjects
772: * @param p The predicate sought.
773: * @param o The property value sought.
774: */
775: ResIterator listSubjectsWithProperty(Property p, String o);
776:
777: /** lists all subjects with a given property and property value.
778:
779: * @return an iterator over the set of subjects
780: * @param p The predicate sought.
781: * @param o The property value sought.
782: * @param l the language associated with the object
783:
784: */
785: ResIterator listSubjectsWithProperty(Property p, String o, String l);
786:
787: /**
788: Answer true iff this model contains the statement (s, p, o') where
789: o' is the typed literal corresponding to the value o.
790: */
791: boolean containsLiteral(Resource s, Property p, boolean o);
792:
793: /**
794: Answer true iff this model contains the statement (s, p, o') where
795: o' is the typed literal corresponding to the value o.
796: */
797: boolean containsLiteral(Resource s, Property p, long o);
798:
799: /**
800: Answer true iff this model contains the statement (s, p, o') where
801: o' is the typed literal corresponding to the value o.
802: */
803: boolean containsLiteral(Resource s, Property p, int o);
804:
805: /**
806: Answer true iff this model contains the statement (s, p, o') where
807: o' is the typed literal corresponding to the value o.
808: */
809: boolean containsLiteral(Resource s, Property p, char o);
810:
811: /**
812: Answer true iff this model contains (s, p, o') where o' is the typed
813: literal corresponding to o.
814: */
815: boolean containsLiteral(Resource s, Property p, float o);
816:
817: /**
818: Answer true iff this model contains the statement (s, p, o') where
819: o' is the typed literal corresponding to the value o.
820: */
821: boolean containsLiteral(Resource s, Property p, double o);
822:
823: /**
824: Answer true iff this model contains the statement (s, p, o') where
825: o' is the typed literal corresponding to the value o.
826: */
827: boolean containsLiteral(Resource s, Property p, Object o);
828:
829: /** Determine if a statement is present in this model.
830: * @return true if the statement with subject s, property p and object o
831: * is in the model, false otherwise
832: * @param s The subject of the statment tested.
833: * @param p The predicate of the statement tested.
834: * @param o The object of the statement tested.
835: */
836: boolean contains(Resource s, Property p, String o);
837:
838: /** Determine if a statement is present in this model.
839: * @return true if the statement with subject s, property p and object o
840: * is in the model, false otherwise
841: * @param s The subject of the statment tested.
842: * @param p The predicate of the statement tested.
843: * @param o The object of the statement tested.
844: * @param l the language associated with the object
845: */
846: boolean contains(Resource s, Property p, String o, String l);
847: }
|