Class JenaParameters


  • public class JenaParameters
    extends java.lang.Object
    This class holds global, static, configuration parameters that affect the behaviour of the Jena API. These should not be changed unless you are sure you know what you are doing and even then should ideally only be changed before any Models are created or processed.

    These parameters should not be regarded as a stable part of the API. If we find them being used significantly that probably means they should be moved to being model-specific rather than global.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static boolean disableBNodeUIDGeneration
      If this flag is true (default is false) then bNodes are assigned a simple count local to this JVM.
      static boolean enableEagerLiteralValidation
      Set this flag to true to cause typed literals to be validated as they are created.
      static boolean enableFilteringOfHiddenInfNodes
      Set this flag to true (default) to hide certain internal nodes from the output of inference graphs.
      static boolean enableOWLRuleOverOWLRuleWarnings
      If this flag is true (default) then attmempts to build an OWL inference graph over another OWL inference graph will log a warning message.
      static boolean enablePlainLiteralSameAsString
      Set this flag to true to allow language-free, plain literals and xsd:strings containing the same character sequence to test as sameAs.
      static boolean enableSilentAcceptanceOfUnknownDatatypes
      Set this flag to true to allow unknown literal datatypes to be accepted, if false then such literals will throw an exception when first detected.
      static boolean enableWhitespaceCheckingOfTypedLiterals
      Set this flag to true to switch on checking of surrounding whitespace in non-string XSD numeric types.
    • Constructor Summary

      Constructors 
      Constructor Description
      JenaParameters()  
    • Method Summary

      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • enableEagerLiteralValidation

        public static boolean enableEagerLiteralValidation

        Set this flag to true to cause typed literals to be validated as they are created.

        RDF does not require ill-formed typed literals to be rejected from a graph but rather allows them to be included but marked as distinct from all legally formed typed literals. Jena2 reflects this by optionally delaying validation of literals against datatype type constraints until the first access.

      • enablePlainLiteralSameAsString

        public static boolean enablePlainLiteralSameAsString
        Set this flag to true to allow language-free, plain literals and xsd:strings containing the same character sequence to test as sameAs.

        RDF plain literals and typed literals of type xsd:string are distinct, not least because plain literals may have a language tag which typed literals may not. However, in the absence of a languge tag it can be convenient for applications if the java objects representing identical character strings in these two ways test as semantically "sameAs" each other. At the time of writing is unclear if such identification would be sanctioned by the RDF working group.

      • enableSilentAcceptanceOfUnknownDatatypes

        public static boolean enableSilentAcceptanceOfUnknownDatatypes
        Set this flag to true to allow unknown literal datatypes to be accepted, if false then such literals will throw an exception when first detected. Note that any datatypes unknown datatypes encountered whilst this flag is 'true' will be automatically registered (as a type whose value and lexical spaces are identical). Subsequently turning off this flag will not unregister those unknown types already encountered.

        RDF allows any URI to be used to indicate a datatype. Jena2 allows user defined datatypes to be registered but it is sometimes convenient to be able to process models containing unknown datatypes (e.g. when the application does not need to touch the value form of the literal). However, this behaviour means that common errors, such as using the wrong URI for xsd datatypes, may go unnoticed and throw obscure errors late in processing. Hence, the default is the require unknown datatypes to be registered.

      • enableWhitespaceCheckingOfTypedLiterals

        public static boolean enableWhitespaceCheckingOfTypedLiterals
        Set this flag to true to switch on checking of surrounding whitespace in non-string XSD numeric types. In the false (default) setting then leading and trailing white space is silently trimmed when parsing an XSD numberic typed literal.
      • enableFilteringOfHiddenInfNodes

        public static boolean enableFilteringOfHiddenInfNodes
        Set this flag to true (default) to hide certain internal nodes from the output of inference graphs. Some rule sets (notably owl-fb) create blank nodes as part of their reasoning process. If these match some query they can appear in the results. Such nodes are recorded as "hidden" and if this flag is set all triples involving such hidden nodes will be removed from the output - any indirect consequences will, however, still be visible.
      • enableOWLRuleOverOWLRuleWarnings

        public static boolean enableOWLRuleOverOWLRuleWarnings
        If this flag is true (default) then attmempts to build an OWL inference graph over another OWL inference graph will log a warning message.
      • disableBNodeUIDGeneration

        public static boolean disableBNodeUIDGeneration
        If this flag is true (default is false) then bNodes are assigned a simple count local to this JVM. This is ONLY for use in debugging systems exhibiting non-deterministic behaviour due to the time-dependence of UIDs, not for normal production use. In particular, it breaks the contract that blank node ids should be unique: they will only be unique for this single JVM run.
    • Constructor Detail

      • JenaParameters

        public JenaParameters()