001: /*
002: * (c) Copyright 2001, 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: $Id: ARPErrorNumbers.java,v 1.33 2008/01/02 12:06:46 andy_seaborne Exp $
028: AUTHOR: Jeremy J. Carroll
029: */
030: /*
031: * ARPErrorNumbers.java
032: *
033: * Created on July 10, 2001, 8:34 AM
034: */
035:
036: package com.hp.hpl.jena.rdf.arp;
037:
038: /**
039: * Error numbers used by ARP.
040: * @author jjc
041: */
042: public interface ARPErrorNumbers {
043: /** Used as ErrorMode to not report an error.
044: * @see ARPOptions#setErrorMode
045: *
046: *
047: */
048: public int EM_IGNORE = 0;
049: /** Used as ErrorMode to report warning and continue processing.
050: * @see ARPOptions#setErrorMode
051: */
052: public int EM_WARNING = 1;
053: /** Used as ErrorMode to report error, and not generate associated triples.
054: *
055: * In the event of an error (i.e. a condition with this error mode),
056: * no further triples involving the resources and literals associated with the error are created.
057: * The precise definition of 'associated with' is deliberately
058: * undefined, and may change in future releases.
059: *
060: * When the file includes fatal error conditions the parsing is aborted immediately after such an error.
061: Otherwise, it is possible to see all the triples, including those involving resources and literals associated with any condition, by ensuring that the error mode of every error code is WARNING or IGNORE. (i.e. ARP optionally permits all errors to be downgraded to warnings, or to be ignored).
062: In this case, the precise rules which ARP uses to generate triples for ill-formed input are not defined by any standard and are subject to change with future releases.
063: For input involving no errors, ARP creates triples in accordance with the RDF/XML Syntax Revised Recommendation.
064: * @see ARPOptions#setErrorMode
065: */
066: public int EM_ERROR = 2;
067: /** Used as ErrorMode to stop processing after reporting error.
068: * @see ARPOptions#setErrorMode
069: */
070: public int EM_FATAL = 3;
071:
072: // All error numbers must be between 1 and 399.
073: // Divide by 100 to get class.
074: /**
075: An xml:lang attribute uses one or more of the extension
076: facilities in RFC3066 or ISO639.
077: *In some way, the langauge specified is non-standard.
078: *
079: *In both default and strict modes this is ignored; a conservative application
080: *in verbose mode may wish to raise a warning.
081: * (W001)
082: *@see com.hp.hpl.jena.rdf.arp.lang.LanguageTagCodes#LT_PRIVATE_USE
083: *@see com.hp.hpl.jena.rdf.arp.lang.LanguageTagCodes#LT_LOCAL_USE
084: *@see com.hp.hpl.jena.rdf.arp.lang.LanguageTagCodes#LT_EXTRA
085: */
086:
087: public int IGN_PRIVATE_XMLLANG = 1;
088:
089: /**
090: Indicates that somewhere, other than in an XML Literal
091: an xml:base attribute has been used.
092: This is ignored in default and strict mode. (W002)
093: @see #IGN_XMLBASE_SIGNIFICANT
094: */
095: public int IGN_XMLBASE_USED = 2;
096: /**
097: Indicates that somewhere,
098: an xml:base attribute has been used and
099: changes the interpretation of some URI (either through a
100: relative URI-reference or rdf:ID). (W003)
101: This is ignored in default and strict mode.
102: @see #IGN_XMLBASE_USED
103: */
104: public int IGN_XMLBASE_SIGNIFICANT = 3;
105: /**
106: The use of rdf:parseType="daml:collection" does
107: not conform with RDF2004.
108: This is ignored in default mode.
109: In strict mode the parser follows the conformant behaviour
110: which is to silently
111: treat this as rdf:parseType="Literal" (W004).
112: */
113: public int IGN_DAML_COLLECTION = 4;
114:
115: /**
116: Indicates that no name is known for the current file being parsed.
117: * (W005)
118: */
119:
120: public int IGN_NO_BASE_URI_SPECIFIED = 5;
121:
122: /**
123:
124: * (W100)
125: * @deprecated {@link #IGN_NO_BASE_URI_SPECIFIED}
126: */
127:
128: public int WARN_XMLBASE_MISSING = 100;
129: /**
130: A standard rdf attribute like type or about is used
131: without a namespace qualifier. In default and strict mode ARP adds the
132: *rdf: qualifier and reports a warning. (W101).
133: */
134: public int WARN_UNQUALIFIED_RDF_ATTRIBUTE = 101;
135: /**
136: *Some attribute that is not an RDF keyword is used in an
137: unqualified fashion. In default mode, then the namespace of
138: the enclosing element
139: is used.
140: In strict mode this is an error. (W102).
141:
142: *
143: */
144: public int WARN_UNQUALIFIED_ATTRIBUTE = 102;
145: /**
146: An attribute name in the RDF namespace has been
147: used that is not a reserved RDF attribute name.
148: *In default and strict modes, a statement is generated with the given name as property.
149: * In default and strict modes this is a warning. (W103).
150: **/
151: public int WARN_UNKNOWN_RDF_ATTRIBUTE = 103;
152: /**
153: An element tag is not a qualified name.
154: In default mode, a resource or property is generated with a malformed URI.
155: * Strict mode treats this as an error. (W104).
156: */
157: public int WARN_UNQUALIFIED_ELEMENT = 104;
158:
159: /**
160: *The same name has been used for more than one rdf:ID or rdf:bagID,
161: * in the context of the same xml:base (if any).
162: The default mode allows this with a warning.
163: This check is expensive in memory. When processing very large files,
164: it may be sensible to switch the check off by using
165: {@link ARPOptions#setErrorMode(int,int)} to ignore this condition.
166: * (W105).
167: @see #WARN_LEGAL_REUSE_OF_ID
168:
169: */
170:
171: public int WARN_REDEFINITION_OF_ID = 105;
172: /**
173: An unrecognised value for rdf:parseType has been found.
174: In strict mode, this error is ignored, and it is treated
175: as rdf:parseType="Literal", in default mode a warning is issued.
176: * (W106)
177: */
178: public int WARN_UNKNOWN_PARSETYPE = 106;
179: /**
180: *A URI reference does not conform to the definition of RDF URI Reference.
181: Use Exception.getMessage() for details.
182: In default mode, the malformed URI is passed to the RDF
183: processing application; strict mode treats this as an error.
184: * (W107)
185:
186: *
187: */
188: public int WARN_MALFORMED_URI = 107;
189: /**
190: *An ID symbol or other grammar production that should be an
191: XML name is malformed. In default mode,
192: the malformed string is passed to the RDF application. (W108)
193: *Strict mode treats this as an error.
194: *
195: */
196: public int WARN_BAD_NAME = 108;
197: /**
198: *A namespace has been declared with a relative URI.
199: Such relative URI namespaces have been
200: <a href="http://www.w3.org/2000/09/xppa">deprecated</a>.
201: This often results in related {@link #WARN_RELATIVE_URI}
202: warnings.
203: (W109)
204: *
205: */
206: public int WARN_RELATIVE_NAMESPACE_URI_DEPRECATED = 109;
207:
208: // public int WARN_EMPTY_ABOUT_EACH =110;
209: /**
210: *No longer used.
211: *(W111)
212: * @deprecated
213:
214: */
215:
216: public int WARN_BAD_XML = 111;
217: /**
218: *
219: *Should not happen.
220: *(W112)
221: *@deprecated No longer used.
222: */
223: public int WARN_MINOR_INTERNAL_ERROR = 112;
224: /**
225: *An element is tagged rdf:XXX where XXX is not a recognised RDF element name.
226: *The typed node or property element construction is matched.
227: *In both default and strict modes this is a warning. (W113).
228: */
229: public int WARN_UNKNOWN_RDF_ELEMENT = 113;
230: /**
231: * rdf:_NNN is being used in the typed node construction.
232: *
233: * In default mode this is a warning; in strict mode it is ignored.(W114)
234: */
235: public int WARN_RDF_NN_AS_TYPE = 114;
236: /**
237: * The value of an xml:lang attribute does not conform to the
238: syntactic rules of RFC3066.
239: In default mode this is a warning, in strict mode an error. (W115)
240: */
241: public int WARN_MALFORMED_XMLLANG = 115;
242: /**
243: * The value of an xml:lang attribute while syntactically conforming
244: to RFC3066 does not conform with other rules, possibly through not
245: being listed in ISO639 or ISO3166 or the IANA language tag
246: registry. The databases used of these registries was a snapshot of
247: July 24, 2001. If you are using language tags that postdate this snapshot,
248: you should ignore this condition.
249: *The use of a three letter tag instead of a two letter tag or use of
250: the language tag "und" is also reported under this condition, see RFC3066.
251: *
252: In default mode this is a warning, in strict mode an error. (W116)
253: */
254: public int WARN_BAD_XMLLANG = 116;
255: /**
256: * An attribute from the xml namespace has been used that is not
257: recognised. (W118).
258: * In default mode this is a warning; in strict mode it is ignored.
259: */
260: public int WARN_UNKNOWN_XML_ATTRIBUTE = 118;
261: /**
262: * An XML processing instruction occurred in RDF content.
263: * Such instructions are ignored, and are usually in error. (W119).
264: * In default mode this is a warning; in strict mode it is ignored.
265: */
266: public int WARN_PROCESSING_INSTRUCTION_IN_RDF = 119;
267: /**
268: * No longer used.
269: * @see #WARN_REDEFINITION_OF_ID
270: @deprecated Last supported in Jena 2.1 - too expensive.
271: */
272: public int WARN_LEGAL_REUSE_OF_ID = 120;
273: /**
274: * String Literals in RDF should not start with a composing char,
275: * as defined by the CharacterModel working draft.
276: * This is particularly important if XML 1.1 compatibility is
277: * required.
278: * This is a warning in both default and strict modes (W121).
279: **/
280: public int WARN_STRING_COMPOSING_CHAR = 121;
281: /**
282: * No longer used. (W122).
283: *
284: * @deprecated Superceded by the more general {@link #WARN_BAD_NAME} */
285: public int WARN_QNAME_AS_ID = 122;
286:
287: /**
288: * No longer used. (W123)
289: *
290: * @deprecated WG decision on <a href=
291: *
292: "http://www.w3.org/2001/sw/RDFCore/20030123-issues/#williams-01"
293: >williams-01</a>.
294: **/
295: public int WARN_URI_COMPOSING_CHAR = 123;
296:
297: /**
298: * Some xmlns declaration has a non-URI as its right hand side.
299: * This currently permits non-ASCII characters, awaiting clarification from
300: * the namespace editor. This is a warning in default mode and an error in
301: * strict mode (W124). */
302: public int WARN_BAD_NAMESPACE_URI = 124;
303: /**
304: * The value of an xml:lang attribute has been deprecated by IANA (W117). In strict and default mode this is a warning.
305: */
306: public int WARN_DEPRECATED_XMLLANG = 117;
307: /**
308: * This is an internal only field, not intended for public use.
309: * In particular, specifically setting the error mode for this
310: * error should be avoided.
311: * Errors with this error code cannot happen. (W125)
312: * When this warning is treated as an error, the non-RDF compliant
313: * daml:collection production is surpressed.
314: **/
315: public int WARN_IN_STRICT_MODE = 125;
316:
317: /**
318: * The SAX Parser generated a warning. Treated as a warning in both default
319: * and strict modes. (W126)
320: */
321: public int WARN_SAX_WARNING = 126;
322:
323: /**
324: * Within RDF, it is not permitted to define an
325: * XML namespace that has a namespace URI with the
326: * RDF namespace URI as a proper prefix. (W127).
327: * A warning in default mode, an error in strict mode.
328: */
329: public int WARN_BAD_RDF_NAMESPACE_URI = 127;
330:
331: /**
332: * Within RDF, it is not permitted to define an
333: * XML namespace that has a namespace URI with the XML
334: * namespace URI as a proper prefix. (W128). A warning in default mode,an
335: * error in strict mode.
336: */
337: public int WARN_BAD_XML_NAMESPACE_URI = 128;
338:
339: /**
340: * ARP was called with an InputSteamReader or a FileReader which used
341: * an encoding differnt from that in the XML declaration. The usual fix
342: * is to use an InputStream or a FileInputStream instead. (W129).
343: * A warning in default mode, an error in strict mode.
344: * @see #ERR_ENCODING_MISMATCH
345: */
346: public int WARN_ENCODING_MISMATCH = 129;
347: /**
348: * A base URI was required but "" was given. The
349: * RDF/XML input includes a relative URI, an rdf:ID or
350: * some other same document reference. (W130).
351: */
352: public int WARN_RESOLVING_URI_AGAINST_EMPTY_BASE = 130;
353:
354: /**
355: * String Literals in RDF should be in Unicode Normal Form C
356: *
357: * * (W131).
358: **/
359: public int WARN_STRING_NOT_NORMAL_FORM_C = 131;
360:
361: /**
362: * The character encoding in the XML declaration is not
363: * fully supported. In particular, advice about
364: * the IANA registry entry, if any, is not available.
365: * This warning is only believed to be applicable to
366: * Java 1.4. Java 1.5 has more extensive support for
367: * this information, and so upgrading from Java 1.4 to Java 1.5
368: * is a plausible response to this warning.
369: * (W132).
370: */
371: public int WARN_UNSUPPORTED_ENCODING = 132;
372:
373: /**
374: * The character encoding in the XML declaration is not
375: * registered with IANA. Hence the RDF/XML file
376: * is not appropriate for use on the Web, but only
377: * for private interactions, between parties agreeing
378: * on the character encoding.
379: * It may not be possible to read this file with superficially
380: * similar Jena installations, let alone with other RDF systems.
381: * (W133).
382: */
383: public int WARN_NON_IANA_ENCODING = 133;
384:
385: /**
386: * The encoding in the XML declaration is an alias
387: * registered with IANA. Better interoperability
388: * is likely by replacing the encoding declaration
389: * with the canonical IANA name, provided in the warning
390: * message.
391: * (W134).
392: */
393: public int WARN_NONCANONICAL_IANA_NAME = 134;
394:
395: /**
396: * It seems likely that the namespace for rdf: has a typo in it.
397: * (W135)
398: */
399: public int WARN_NOT_RDF_NAMESPACE = 135;
400:
401: /**
402: *A URI reference which is a relative reference
403: *has been used either as the starting base URI
404: *or as the outcome of a URI resolution somehow.
405: *In strict mode this is an error.
406: *(W136)
407: */
408: public int WARN_RELATIVE_URI = 136;
409:
410: /**
411: * After 10000 rdf:ID attributes have been
412: * read, ARP no longer checks for
413: * {@link #WARN_REDEFINITION_OF_ID}.
414: * This warning is to inform the user that
415: * ARP behaviour has changed during parsing.
416: *
417: */
418: public int WARN_BIG_FILE = 137;
419:
420: /** Should not happen.
421: (E200)
422: @deprecated No longer used.
423: */
424: public int ERR_INTERNAL_ERROR = 200;
425: /** The attributes or element tags contravene the RDF grammar.
426: (XML syntax errors are not reported with this mechanism,
427: but as {@link org.xml.sax.SAXParseException SAXParseException}'s).
428: The detailed error message indicates the nature of the contravention.
429: Future releases may specialize these codes, it is better to
430: use {@link ParseException#isSyntaxError()} to check for syntax errors.
431: (E201).
432: */
433: public int ERR_SYNTAX_ERROR = 201;
434: /** Non-white character data has occurred where the RDF grammar
435: does not permit it. This is a special case of ERR_SYNTAX_ERROR,
436: which is detected differently.
437: (E202)
438: */
439: public int ERR_NOT_WHITESPACE = 202;
440: /** rdf:aboutEach may only occur in a top-level obj expansion,
441: * either an rdf:Description or a typed node. This is a special
442: * case of ERR_SYNTAX_ERROR, which is detected differently. (E203).
443: * @deprecated No longer occurs. Any use of rdf:aboutEach is a syntax error.
444: *
445: */
446:
447: public int ERR_ABOUTEACH_NOT_TOPLEVEL = 203;
448: /**
449: * rdf:li is being used in the typed node construction.
450: * (E204)
451: */
452: public int ERR_LI_AS_TYPE = 204;
453: /**
454: *An element is tagged rdf:XXX where XXX is an RDF attribute name.
455: * (E205)
456: */
457: public int ERR_BAD_RDF_ELEMENT = 205;
458: /**
459: An attribute name in the RDF namespace has been
460: used that is reserved as an RDF name, but not as an attribute.
461: These are rdf:Description, rdf:aboutEach, rdf:aboutEachPrefix.
462: The latter two are deprecated. (E206).
463: **/
464: public int ERR_BAD_RDF_ATTRIBUTE = 206;
465: /**
466: * No longer used.
467: * @see #WARN_STRING_NOT_NORMAL_FORM_C
468: @deprecated See 2nd Last Call docs
469: *
470: * * (E207).
471: **/
472: public int ERR_STRING_NOT_NORMAL_FORM_C = 207;
473: /**
474: * No longer used.(E208).
475: * @deprecated WG decision on <a href=
476: *
477: "http://www.w3.org/2001/sw/RDFCore/20030123-issues/#williams-01"
478: >williams-01</a>.
479: */
480: public int ERR_URI_NOT_NORMAL_FORM_C = 208;
481: /**
482: * The SAX Parser generated an error.
483: * Treated as an error in both default and strict modes. (E209)
484: */
485: public int ERR_SAX_ERROR = 209;
486:
487: /**
488: * ARP was called with an InputSteamReader or a FileReader which used
489: * an encoding differnt from that in the XML declaration. Moreover, this
490: * was detected as probably significant (i.e. the document includes
491: * characters outside the ascii range). The usual fix is to use an
492: * InputStream or a FileInputStream instead. (E210).
493: * @see #WARN_ENCODING_MISMATCH
494: */
495: public int ERR_ENCODING_MISMATCH = 210;
496:
497: /**
498: * A base URI was required but not given. The
499: * RDF/XML input includes a relative URI, an rdf:ID or
500: * some other same document reference. (E211).
501: */
502: public int ERR_RESOLVING_URI_AGAINST_NULL_BASE = 211;
503: /**
504: * The document claimed to be UTF-8 but was not.
505: * It probably needs an xml declaration with
506: * an encoding attribute. (E212).
507: */
508: public int ERR_UTF_ENCODING = 212;
509: /**
510: * An IOException occurred. (E213).
511: */
512: public int ERR_GENERIC_IO = 213;
513:
514: /**
515: * Cannot resolve a relative URI, because base URI is malformed.
516: * The base URI, specified in the API call, or
517: * with an xml:base was malformed,
518: * (see {@link #WARN_MALFORMED_URI}).
519: * A relative URI needs to be resolved against it,
520: * and this cannot be done correctly. (E214)
521: */
522: public int ERR_RESOLVING_AGAINST_MALFORMED_BASE = 214;
523: /**
524: * Cannot resolve a relative URI, because base URI is relative.
525: * The base URI, specified in the API call, or
526: * with an xml:base was relative {@link #WARN_RELATIVE_URI}.
527: * A relative URI needs to be resolved against it,
528: * resulting in a relative URI. (E215)
529: */
530: public int ERR_RESOLVING_AGAINST_RELATIVE_BASE = 215;
531:
532: /** No longer used. (E300)
533: * @deprecated Not used.
534: **/
535: public int ERR_UNABLE_TO_RECOVER = 300;
536:
537: /** The SAX Parser generated a fatal error.
538: * Resetting this mode is not supported.
539: * Treated as a fatal error in both
540: * default and strict modes. (E301) */
541: public int ERR_SAX_FATAL_ERROR = 301;
542:
543: /** The Thread was interrupted. (E302) */
544: public int ERR_INTERRUPTED = 302;
545:
546: }
|