Separate RDF and JAX-RS support into separate projects. Project: http://git-wip-us.apache.org/repos/asf/incubator-juneau/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-juneau/commit/e4dfdf81 Tree: http://git-wip-us.apache.org/repos/asf/incubator-juneau/tree/e4dfdf81 Diff: http://git-wip-us.apache.org/repos/asf/incubator-juneau/diff/e4dfdf81
Branch: refs/heads/master Commit: e4dfdf81f05f90eea8be4680487f1b93aac24367 Parents: 95d94d0 Author: JamesBognar <[email protected]> Authored: Sat Jan 21 19:38:54 2017 -0500 Committer: JamesBognar <[email protected]> Committed: Sat Jan 21 19:38:54 2017 -0500 ---------------------------------------------------------------------- juneau-all/pom.xml | 5 + juneau-core-rdf/.gitignore | 5 + juneau-core-rdf/.project | 28 + juneau-core-rdf/pom.xml | 107 + .../java/org/apache/juneau/jena/Constants.java | 93 + .../org/apache/juneau/jena/RdfBeanMeta.java | 61 + .../apache/juneau/jena/RdfBeanPropertyMeta.java | 93 + .../org/apache/juneau/jena/RdfClassMeta.java | 87 + .../apache/juneau/jena/RdfCollectionFormat.java | 53 + .../apache/juneau/jena/RdfCommonContext.java | 753 ++++++ .../java/org/apache/juneau/jena/RdfParser.java | 502 ++++ .../apache/juneau/jena/RdfParserContext.java | 115 + .../apache/juneau/jena/RdfParserSession.java | 234 ++ .../org/apache/juneau/jena/RdfSerializer.java | 466 ++++ .../juneau/jena/RdfSerializerContext.java | 196 ++ .../juneau/jena/RdfSerializerSession.java | 271 +++ .../java/org/apache/juneau/jena/RdfUtils.java | 91 + .../org/apache/juneau/jena/annotation/Rdf.java | 71 + .../apache/juneau/jena/annotation/RdfNs.java | 39 + .../juneau/jena/annotation/RdfSchema.java | 92 + .../apache/juneau/jena/annotation/package.html | 41 + .../juneau/jena/doc-files/Example_HTML.png | Bin 0 -> 35528 bytes .../apache/juneau/jena/doc-files/Example_N3.png | Bin 0 -> 37430 bytes .../juneau/jena/doc-files/Example_NTriple.png | Bin 0 -> 48413 bytes .../juneau/jena/doc-files/Example_RDFXML.png | Bin 0 -> 30486 bytes .../jena/doc-files/Example_RDFXMLABBREV.png | Bin 0 -> 30356 bytes .../juneau/jena/doc-files/Example_Turtle.png | Bin 0 -> 35328 bytes .../java/org/apache/juneau/jena/package.html | 1445 ++++++++++++ juneau-core-rdf/src/main/resources/.gitignore | 12 + juneau-core-test/.gitignore | 5 + juneau-core-test/.project | 28 + juneau-core-test/pom.xml | 112 + .../java/org/apache/juneau/AnnotationsTest.java | 82 + .../java/org/apache/juneau/BeanConfigTest.java | 861 +++++++ .../java/org/apache/juneau/BeanFilterTest.java | 143 ++ .../java/org/apache/juneau/BeanMapTest.java | 1931 ++++++++++++++++ .../java/org/apache/juneau/ClassMetaTest.java | 281 +++ .../org/apache/juneau/ContextFactoryTest.java | 823 +++++++ .../org/apache/juneau/DataConversionTest.java | 155 ++ .../org/apache/juneau/IgnoredClassesTest.java | 73 + .../java/org/apache/juneau/JacocoDummyTest.java | 47 + .../java/org/apache/juneau/ObjectListTest.java | 99 + .../java/org/apache/juneau/ObjectMapTest.java | 314 +++ .../org/apache/juneau/ParserGenericsTest.java | 71 + .../org/apache/juneau/ParserReaderTest.java | 182 ++ .../java/org/apache/juneau/PojoSwapTest.java | 57 + .../juneau/PropertyNamerDashedLcTest.java | 40 + .../test/java/org/apache/juneau/TestUtils.java | 475 ++++ .../java/org/apache/juneau/VisibilityTest.java | 170 ++ .../org/apache/juneau/XmlValidatorParser.java | 74 + .../src/test/java/org/apache/juneau/a/A1.java | 191 ++ .../a/rttests/RoundTripAddClassAttrsTest.java | 358 +++ .../a/rttests/RoundTripBeanInheritanceTest.java | 218 ++ .../juneau/a/rttests/RoundTripBeanMapsTest.java | 1014 +++++++++ .../juneau/a/rttests/RoundTripClassesTest.java | 54 + .../juneau/a/rttests/RoundTripDTOsTest.java | 49 + .../juneau/a/rttests/RoundTripEnumTest.java | 246 ++ .../juneau/a/rttests/RoundTripGenericsTest.java | 98 + .../a/rttests/RoundTripLargeObjectsTest.java | 193 ++ .../juneau/a/rttests/RoundTripMapsTest.java | 214 ++ .../RoundTripNumericConstructorsTest.java | 49 + .../rttests/RoundTripObjectsAsStringsTest.java | 272 +++ .../RoundTripObjectsWithSpecialMethodsTest.java | 114 + .../RoundTripPrimitiveObjectBeansTest.java | 198 ++ .../a/rttests/RoundTripPrimitivesBeansTest.java | 367 +++ .../a/rttests/RoundTripReadOnlyBeansTest.java | 101 + .../a/rttests/RoundTripSimpleObjectsTest.java | 750 ++++++ .../apache/juneau/a/rttests/RoundTripTest.java | 326 +++ .../a/rttests/RoundTripToObjectMapsTest.java | 77 + .../a/rttests/RoundTripTransformBeansTest.java | 381 ++++ .../a/rttests/RoundTripTrimStringsTest.java | 97 + .../java/org/apache/juneau/csv/CsvTest.java | 51 + .../org/apache/juneau/dto/atom/AtomTest.java | 201 ++ .../apache/juneau/dto/cognos/CognosXmlTest.java | 112 + .../juneau/dto/html/BasicHtmlSchemaTest.java | 156 ++ .../juneau/dto/jsonschema/JsonSchemaTest.java | 203 ++ .../org/apache/juneau/html/BasicHtmlTest.java | 1616 +++++++++++++ .../apache/juneau/html/CommonParserTest.java | 164 ++ .../java/org/apache/juneau/html/CommonTest.java | 675 ++++++ .../java/org/apache/juneau/html/HtmlTest.java | 309 +++ .../org/apache/juneau/ini/ConfigFileTest.java | 2153 +++++++++++++++++ .../org/apache/juneau/ini/ConfigMgrTest.java | 204 ++ .../juneau/internal/VersionRangeTest.java | 70 + .../apache/juneau/jena/CommonParserTest.java | 207 ++ .../java/org/apache/juneau/jena/CommonTest.java | 514 +++++ .../org/apache/juneau/jena/CommonXmlTest.java | 97 + .../org/apache/juneau/jena/RdfParserTest.java | 159 ++ .../java/org/apache/juneau/jena/RdfTest.java | 595 +++++ .../apache/juneau/json/CommonParserTest.java | 182 ++ .../java/org/apache/juneau/json/CommonTest.java | 501 ++++ .../juneau/json/JsonParserEdgeCasesTest.java | 626 +++++ .../org/apache/juneau/json/JsonParserTest.java | 325 +++ .../org/apache/juneau/json/JsonSchemaTest.java | 45 + .../java/org/apache/juneau/json/JsonTest.java | 307 +++ .../juneau/msgpack/MsgPackSerialzierTest.java | 215 ++ .../testbeans/PrimitiveAtomicObjectsBean.java | 76 + .../juneau/testbeans/PrimitiveObjectsBean.java | 198 ++ .../org/apache/juneau/testbeans/TestURI.java | 70 + .../juneau/transforms/BeanFilterTest.java | 205 ++ .../apache/juneau/transforms/BeanMapTest.java | 97 + .../transforms/ByteArrayBase64SwapTest.java | 175 ++ .../juneau/transforms/CalendarSwapTest.java | 709 ++++++ .../juneau/transforms/DateFilterTest.java | 165 ++ .../juneau/transforms/EnumerationSwapTest.java | 36 + .../juneau/transforms/IteratorSwapTest.java | 38 + .../juneau/transforms/LocalizedDatesTest.java | 635 ++++++ .../juneau/transforms/ReaderFilterTest.java | 48 + .../urlencoding/CommonParser_UonTest.java | 170 ++ .../CommonParser_UrlEncodingTest.java | 187 ++ .../juneau/urlencoding/Common_UonTest.java | 450 ++++ .../urlencoding/Common_UrlEncodingTest.java | 442 ++++ .../org/apache/juneau/urlencoding/DTOs.java | 141 ++ .../juneau/urlencoding/UonParserReaderTest.java | 218 ++ .../juneau/urlencoding/UonParserTest.java | 542 +++++ .../juneau/urlencoding/UonSerializerTest.java | 461 ++++ .../urlencoding/UrlEncodingParserTest.java | 1000 ++++++++ .../urlencoding/UrlEncodingSerializerTest.java | 495 ++++ .../java/org/apache/juneau/utils/ArgsTest.java | 71 + .../org/apache/juneau/utils/ArrayUtilsTest.java | 161 ++ .../apache/juneau/utils/ByteArrayCacheTest.java | 61 + .../juneau/utils/ByteArrayInOutStreamTest.java | 35 + .../org/apache/juneau/utils/CharSetTest.java | 35 + .../org/apache/juneau/utils/ClassUtilsTest.java | 115 + .../juneau/utils/CollectionUtilsTest.java | 35 + .../apache/juneau/utils/FilteredMapTest.java | 50 + .../org/apache/juneau/utils/IOPipeTest.java | 283 +++ .../org/apache/juneau/utils/IOUtilsTest.java | 104 + .../apache/juneau/utils/IdentityListTest.java | 39 + .../apache/juneau/utils/KeywordStoreTest.java | 46 + .../apache/juneau/utils/MultiIterableTest.java | 71 + .../org/apache/juneau/utils/MultiSetTest.java | 144 ++ .../apache/juneau/utils/ParserReaderTest.java | 49 + .../juneau/utils/PojoIntrospectorTest.java | 54 + .../org/apache/juneau/utils/PojoQueryTest.java | 680 ++++++ .../org/apache/juneau/utils/PojoRestTest.java | 854 +++++++ .../org/apache/juneau/utils/SimpleMapTest.java | 49 + .../juneau/utils/StringBuilderWriterTest.java | 60 + .../apache/juneau/utils/StringUtilsTest.java | 704 ++++++ .../juneau/utils/StringVarResolverTest.java | 333 +++ .../org/apache/juneau/xml/BasicXmlTest.java | 1508 ++++++++++++ .../org/apache/juneau/xml/CommonParserTest.java | 179 ++ .../java/org/apache/juneau/xml/CommonTest.java | 463 ++++ .../org/apache/juneau/xml/CommonXmlTest.java | 81 + .../apache/juneau/xml/InvalidXmlBeansTest.java | 230 ++ .../org/apache/juneau/xml/XmlCollapsedTest.java | 434 ++++ .../org/apache/juneau/xml/XmlContentTest.java | 261 +++ .../org/apache/juneau/xml/XmlParserTest.java | 96 + .../java/org/apache/juneau/xml/XmlTest.java | 1050 +++++++++ .../java/org/apache/juneau/xml/xml1a/T1.java | 38 + .../java/org/apache/juneau/xml/xml1a/T2.java | 38 + .../java/org/apache/juneau/xml/xml1b/T3.java | 37 + .../java/org/apache/juneau/xml/xml1b/T4.java | 37 + .../java/org/apache/juneau/xml/xml1b/T5.java | 38 + .../java/org/apache/juneau/xml/xml1b/T6.java | 38 + .../java/org/apache/juneau/xml/xml1b/T7.java | 37 + .../apache/juneau/xml/xml1b/package-info.java | 16 + .../java/org/apache/juneau/xml/xml1c/T8.java | 33 + .../java/org/apache/juneau/xml/xml1c/T9.java | 23 + .../apache/juneau/xml/xml1c/package-info.java | 25 + juneau-core/pom.xml | 9 - .../java/org/apache/juneau/BeanSession.java | 3 +- .../java/org/apache/juneau/jena/Constants.java | 93 - .../org/apache/juneau/jena/RdfBeanMeta.java | 61 - .../apache/juneau/jena/RdfBeanPropertyMeta.java | 93 - .../org/apache/juneau/jena/RdfClassMeta.java | 87 - .../apache/juneau/jena/RdfCollectionFormat.java | 53 - .../apache/juneau/jena/RdfCommonContext.java | 753 ------ .../java/org/apache/juneau/jena/RdfParser.java | 502 ---- .../apache/juneau/jena/RdfParserContext.java | 115 - .../apache/juneau/jena/RdfParserSession.java | 234 -- .../org/apache/juneau/jena/RdfSerializer.java | 466 ---- .../juneau/jena/RdfSerializerContext.java | 196 -- .../juneau/jena/RdfSerializerSession.java | 271 --- .../java/org/apache/juneau/jena/RdfUtils.java | 91 - .../org/apache/juneau/jena/annotation/Rdf.java | 71 - .../apache/juneau/jena/annotation/RdfNs.java | 39 - .../juneau/jena/annotation/RdfSchema.java | 92 - .../apache/juneau/jena/annotation/package.html | 41 - .../juneau/jena/doc-files/Example_HTML.png | Bin 35528 -> 0 bytes .../apache/juneau/jena/doc-files/Example_N3.png | Bin 37430 -> 0 bytes .../juneau/jena/doc-files/Example_NTriple.png | Bin 48413 -> 0 bytes .../juneau/jena/doc-files/Example_RDFXML.png | Bin 30486 -> 0 bytes .../jena/doc-files/Example_RDFXMLABBREV.png | Bin 30356 -> 0 bytes .../juneau/jena/doc-files/Example_Turtle.png | Bin 35328 -> 0 bytes .../java/org/apache/juneau/jena/package.html | 1445 ------------ .../java/org/apache/juneau/AnnotationsTest.java | 82 - .../java/org/apache/juneau/BeanConfigTest.java | 861 ------- .../java/org/apache/juneau/BeanFilterTest.java | 143 -- .../java/org/apache/juneau/BeanMapTest.java | 1931 ---------------- .../java/org/apache/juneau/ClassMetaTest.java | 281 --- .../org/apache/juneau/ContextFactoryTest.java | 823 ------- .../org/apache/juneau/DataConversionTest.java | 155 -- .../org/apache/juneau/IgnoredClassesTest.java | 73 - .../java/org/apache/juneau/JacocoDummyTest.java | 47 - .../java/org/apache/juneau/ObjectListTest.java | 99 - .../java/org/apache/juneau/ObjectMapTest.java | 314 --- .../org/apache/juneau/ParserGenericsTest.java | 71 - .../org/apache/juneau/ParserReaderTest.java | 182 -- .../java/org/apache/juneau/PojoSwapTest.java | 57 - .../juneau/PropertyNamerDashedLcTest.java | 40 - .../test/java/org/apache/juneau/TestUtils.java | 475 ---- .../java/org/apache/juneau/VisibilityTest.java | 170 -- .../org/apache/juneau/XmlValidatorParser.java | 74 - .../src/test/java/org/apache/juneau/a/A1.java | 191 -- .../a/rttests/RoundTripAddClassAttrsTest.java | 358 --- .../a/rttests/RoundTripBeanInheritanceTest.java | 218 -- .../juneau/a/rttests/RoundTripBeanMapsTest.java | 1014 --------- .../juneau/a/rttests/RoundTripClassesTest.java | 54 - .../juneau/a/rttests/RoundTripDTOsTest.java | 49 - .../juneau/a/rttests/RoundTripEnumTest.java | 246 -- .../juneau/a/rttests/RoundTripGenericsTest.java | 98 - .../a/rttests/RoundTripLargeObjectsTest.java | 193 -- .../juneau/a/rttests/RoundTripMapsTest.java | 214 -- .../RoundTripNumericConstructorsTest.java | 49 - .../rttests/RoundTripObjectsAsStringsTest.java | 272 --- .../RoundTripObjectsWithSpecialMethodsTest.java | 114 - .../RoundTripPrimitiveObjectBeansTest.java | 198 -- .../a/rttests/RoundTripPrimitivesBeansTest.java | 367 --- .../a/rttests/RoundTripReadOnlyBeansTest.java | 101 - .../a/rttests/RoundTripSimpleObjectsTest.java | 750 ------ .../apache/juneau/a/rttests/RoundTripTest.java | 326 --- .../a/rttests/RoundTripToObjectMapsTest.java | 77 - .../a/rttests/RoundTripTransformBeansTest.java | 381 ---- .../a/rttests/RoundTripTrimStringsTest.java | 98 - .../java/org/apache/juneau/csv/CsvTest.java | 51 - .../org/apache/juneau/dto/atom/AtomTest.java | 201 -- .../apache/juneau/dto/cognos/CognosXmlTest.java | 112 - .../juneau/dto/html/BasicHtmlSchemaTest.java | 156 -- .../juneau/dto/jsonschema/JsonSchemaTest.java | 203 -- .../org/apache/juneau/html/BasicHtmlTest.java | 1614 ------------- .../apache/juneau/html/CommonParserTest.java | 164 -- .../java/org/apache/juneau/html/CommonTest.java | 675 ------ .../java/org/apache/juneau/html/HtmlTest.java | 309 --- .../org/apache/juneau/ini/ConfigFileTest.java | 2154 ------------------ .../org/apache/juneau/ini/ConfigMgrTest.java | 204 -- .../juneau/internal/VersionRangeTest.java | 70 - .../apache/juneau/jena/CommonParserTest.java | 207 -- .../java/org/apache/juneau/jena/CommonTest.java | 514 ----- .../org/apache/juneau/jena/CommonXmlTest.java | 97 - .../org/apache/juneau/jena/RdfParserTest.java | 159 -- .../java/org/apache/juneau/jena/RdfTest.java | 595 ----- .../apache/juneau/json/CommonParserTest.java | 182 -- .../java/org/apache/juneau/json/CommonTest.java | 501 ---- .../juneau/json/JsonParserEdgeCasesTest.java | 626 ----- .../org/apache/juneau/json/JsonParserTest.java | 325 --- .../org/apache/juneau/json/JsonSchemaTest.java | 45 - .../java/org/apache/juneau/json/JsonTest.java | 307 --- .../juneau/msgpack/MsgPackSerialzierTest.java | 215 -- .../testbeans/PrimitiveAtomicObjectsBean.java | 76 - .../juneau/testbeans/PrimitiveObjectsBean.java | 198 -- .../org/apache/juneau/testbeans/TestURI.java | 70 - .../juneau/transforms/BeanFilterTest.java | 205 -- .../apache/juneau/transforms/BeanMapTest.java | 97 - .../transforms/ByteArrayBase64SwapTest.java | 175 -- .../juneau/transforms/CalendarSwapTest.java | 709 ------ .../juneau/transforms/DateFilterTest.java | 165 -- .../juneau/transforms/EnumerationSwapTest.java | 36 - .../juneau/transforms/IteratorSwapTest.java | 38 - .../juneau/transforms/LocalizedDatesTest.java | 635 ------ .../juneau/transforms/ReaderFilterTest.java | 48 - .../urlencoding/CommonParser_UonTest.java | 170 -- .../CommonParser_UrlEncodingTest.java | 187 -- .../juneau/urlencoding/Common_UonTest.java | 450 ---- .../urlencoding/Common_UrlEncodingTest.java | 442 ---- .../org/apache/juneau/urlencoding/DTOs.java | 141 -- .../juneau/urlencoding/UonParserReaderTest.java | 218 -- .../juneau/urlencoding/UonParserTest.java | 542 ----- .../juneau/urlencoding/UonSerializerTest.java | 461 ---- .../urlencoding/UrlEncodingParserTest.java | 1000 -------- .../urlencoding/UrlEncodingSerializerTest.java | 498 ---- .../java/org/apache/juneau/utils/ArgsTest.java | 71 - .../org/apache/juneau/utils/ArrayUtilsTest.java | 161 -- .../apache/juneau/utils/ByteArrayCacheTest.java | 61 - .../juneau/utils/ByteArrayInOutStreamTest.java | 35 - .../org/apache/juneau/utils/CharSetTest.java | 35 - .../org/apache/juneau/utils/ClassUtilsTest.java | 115 - .../juneau/utils/CollectionUtilsTest.java | 35 - .../apache/juneau/utils/FilteredMapTest.java | 50 - .../org/apache/juneau/utils/IOPipeTest.java | 283 --- .../org/apache/juneau/utils/IOUtilsTest.java | 104 - .../apache/juneau/utils/IdentityListTest.java | 39 - .../apache/juneau/utils/KeywordStoreTest.java | 46 - .../apache/juneau/utils/MultiIterableTest.java | 71 - .../org/apache/juneau/utils/MultiSetTest.java | 144 -- .../apache/juneau/utils/ParserReaderTest.java | 49 - .../juneau/utils/PojoIntrospectorTest.java | 54 - .../org/apache/juneau/utils/PojoQueryTest.java | 680 ------ .../org/apache/juneau/utils/PojoRestTest.java | 854 ------- .../org/apache/juneau/utils/SimpleMapTest.java | 49 - .../juneau/utils/StringBuilderWriterTest.java | 60 - .../apache/juneau/utils/StringUtilsTest.java | 704 ------ .../juneau/utils/StringVarResolverTest.java | 333 --- .../org/apache/juneau/xml/BasicXmlTest.java | 1505 ------------ .../org/apache/juneau/xml/CommonParserTest.java | 179 -- .../java/org/apache/juneau/xml/CommonTest.java | 463 ---- .../org/apache/juneau/xml/CommonXmlTest.java | 81 - .../apache/juneau/xml/InvalidXmlBeansTest.java | 230 -- .../org/apache/juneau/xml/XmlCollapsedTest.java | 434 ---- .../org/apache/juneau/xml/XmlContentTest.java | 261 --- .../org/apache/juneau/xml/XmlParserTest.java | 96 - .../java/org/apache/juneau/xml/XmlTest.java | 1050 --------- .../java/org/apache/juneau/xml/xml1a/T1.java | 38 - .../java/org/apache/juneau/xml/xml1a/T2.java | 38 - .../java/org/apache/juneau/xml/xml1b/T3.java | 37 - .../java/org/apache/juneau/xml/xml1b/T4.java | 37 - .../java/org/apache/juneau/xml/xml1b/T5.java | 38 - .../java/org/apache/juneau/xml/xml1b/T6.java | 38 - .../java/org/apache/juneau/xml/xml1b/T7.java | 37 - .../apache/juneau/xml/xml1b/package-info.java | 16 - .../java/org/apache/juneau/xml/xml1c/T8.java | 33 - .../java/org/apache/juneau/xml/xml1c/T9.java | 23 - .../apache/juneau/xml/xml1c/package-info.java | 25 - juneau-rest-client/pom.xml | 2 +- juneau-rest-jaxrs/.gitignore | 4 + juneau-rest-jaxrs/.project | 30 + juneau-rest-jaxrs/pom.xml | 97 + .../apache/juneau/rest/jaxrs/BaseProvider.java | 189 ++ .../juneau/rest/jaxrs/DefaultProvider.java | 71 + .../juneau/rest/jaxrs/JuneauProvider.java | 96 + .../org/apache/juneau/rest/jaxrs/package.html | 360 +++ .../rest/jaxrs/rdf/DefaultJenaProvider.java | 91 + .../apache/juneau/rest/jaxrs/rdf/package.html | 34 + juneau-rest-test/pom.xml | 7 +- juneau-rest/pom.xml | 7 +- pom.xml | 7 +- 325 files changed, 42181 insertions(+), 40904 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/e4dfdf81/juneau-all/pom.xml ---------------------------------------------------------------------- diff --git a/juneau-all/pom.xml b/juneau-all/pom.xml index 4e879ad..0143170 100644 --- a/juneau-all/pom.xml +++ b/juneau-all/pom.xml @@ -36,6 +36,11 @@ </dependency> <dependency> <groupId>org.apache.juneau</groupId> + <artifactId>juneau-core-rdf</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.juneau</groupId> <artifactId>juneau-rest</artifactId> <version>${project.version}</version> </dependency> http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/e4dfdf81/juneau-core-rdf/.gitignore ---------------------------------------------------------------------- diff --git a/juneau-core-rdf/.gitignore b/juneau-core-rdf/.gitignore new file mode 100644 index 0000000..5b1eab9 --- /dev/null +++ b/juneau-core-rdf/.gitignore @@ -0,0 +1,5 @@ +/target/ +/.DS_Store +/.settings/ +/.classpath +/bin/ http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/e4dfdf81/juneau-core-rdf/.project ---------------------------------------------------------------------- diff --git a/juneau-core-rdf/.project b/juneau-core-rdf/.project new file mode 100644 index 0000000..fe1874b --- /dev/null +++ b/juneau-core-rdf/.project @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + *************************************************************************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file * + * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance * + * with the License. You may obtain a copy of the License at * + * * + * http://www.apache.org/licenses/LICENSE-2.0 * + * * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an * + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * + * specific language governing permissions and limitations under the License. * + *************************************************************************************************************************** +--> +<projectDescription> + <name>juneau-core</name> + <comment>Base toolkit for serializers, parsers, and bean contexts. NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment> + <projects/> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/e4dfdf81/juneau-core-rdf/pom.xml ---------------------------------------------------------------------- diff --git a/juneau-core-rdf/pom.xml b/juneau-core-rdf/pom.xml new file mode 100644 index 0000000..4ecfa42 --- /dev/null +++ b/juneau-core-rdf/pom.xml @@ -0,0 +1,107 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + *************************************************************************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file * + * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance * + * with the License. You may obtain a copy of the License at * + * * + * http://www.apache.org/licenses/LICENSE-2.0 * + * * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an * + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * + * specific language governing permissions and limitations under the License. * + *************************************************************************************************************************** +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + + <modelVersion>4.0.0</modelVersion> + <artifactId>juneau-core-rdf</artifactId> + <name>Apache Juneau Core RDF Support</name> + <description>Addition to the core API for RDF support.</description> + <packaging>bundle</packaging> + + <parent> + <groupId>org.apache.juneau</groupId> + <artifactId>juneau</artifactId> + <version>6.0.2-incubating-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + + <dependencies> + <dependency> + <groupId>org.apache.juneau</groupId> + <artifactId>juneau-core</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>org.apache.jena</groupId> + <artifactId>jena-core</artifactId> + <optional>true</optional> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + </dependency> + </dependencies> + + <properties> + <!-- Skip javadoc generation since we generate them in the aggregate pom --> + <maven.javadoc.skip>true</maven.javadoc.skip> + </properties> + + <build> + <plugins> + <plugin> + <groupId>org.apache.felix</groupId> + <artifactId>maven-bundle-plugin</artifactId> + <version>3.2.0</version> + <extensions>true</extensions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <version>2.19.1</version> + <configuration> + <includes> + <include>**/*Test.class</include> + </includes> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-source-plugin</artifactId> + <version>3.0.1</version> + <executions> + <execution> + <id>attach-sources</id> + <phase>verify</phase> + <goals> + <goal>jar-no-fork</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.jacoco</groupId> + <artifactId>jacoco-maven-plugin</artifactId> + <version>0.7.2.201409121644</version> + <executions> + <execution> + <id>default-prepare-agent</id> + <goals> + <goal>prepare-agent</goal> + </goals> + </execution> + <execution> + <id>default-report</id> + <phase>prepare-package</phase> + <goals> + <goal>report</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/e4dfdf81/juneau-core-rdf/src/main/java/org/apache/juneau/jena/Constants.java ---------------------------------------------------------------------- diff --git a/juneau-core-rdf/src/main/java/org/apache/juneau/jena/Constants.java b/juneau-core-rdf/src/main/java/org/apache/juneau/jena/Constants.java new file mode 100644 index 0000000..1e4d8ea --- /dev/null +++ b/juneau-core-rdf/src/main/java/org/apache/juneau/jena/Constants.java @@ -0,0 +1,93 @@ +// *************************************************************************************************************************** +// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file * +// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file * +// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance * +// * with the License. You may obtain a copy of the License at * +// * * +// * http://www.apache.org/licenses/LICENSE-2.0 * +// * * +// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an * +// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * +// * specific language governing permissions and limitations under the License. * +// *************************************************************************************************************************** +package org.apache.juneau.jena; + +import org.apache.juneau.serializer.*; + +/** + * Constants used by the {@link RdfSerializer} and {@link RdfParser} classes. + */ +public final class Constants { + + //-------------------------------------------------------------------------------- + // Built-in Jena languages. + //-------------------------------------------------------------------------------- + + /** Jena language support: <js>"RDF/XML"</js>.*/ + public static final String LANG_RDF_XML = "RDF/XML"; + + /** Jena language support: <js>"RDF/XML-ABBREV"</js>.*/ + public static final String LANG_RDF_XML_ABBREV = "RDF/XML-ABBREV"; + + /** Jena language support: <js>"N-TRIPLE"</js>.*/ + public static final String LANG_NTRIPLE = "N-TRIPLE"; + + /** Jena language support: <js>"TURTLE"</js>.*/ + public static final String LANG_TURTLE = "TURTLE"; + + /** Jena language support: <js>"N3"</js>.*/ + public static final String LANG_N3 = "N3"; + + + //-------------------------------------------------------------------------------- + // Built-in Juneau properties. + //-------------------------------------------------------------------------------- + + /** + * RDF property identifier <js>"items"</js>. + * <p> + * For resources that are collections, this property identifies the RDF Sequence + * container for the items in the collection. + */ + public static final String RDF_juneauNs_ITEMS = "items"; + + /** + * RDF property identifier <js>"root"</js>. + * <p> + * Property added to root nodes to help identify them as root elements during parsing. + * <p> + * Added if {@link RdfSerializerContext#RDF_addRootProperty} setting is enabled. + */ + public static final String RDF_juneauNs_ROOT = "root"; + + /** + * RDF property identifier <js>"class"</js>. + * <p> + * Property added to bean resources to identify the class type. + * <p> + * Added if {@link SerializerContext#SERIALIZER_addBeanTypeProperties} setting is enabled. + */ + public static final String RDF_juneauNs_CLASS = "class"; + + /** + * RDF property identifier <js>"value"</js>. + * <p> + * Property added to nodes to identify a simple value. + */ + public static final String RDF_juneauNs_VALUE = "value"; + + /** + * RDF resource that identifies a <jk>null</jk> value. + */ + public static final String RDF_NIL = "http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"; + + /** + * RDF resource that identifies a <code>Seq</code> value. + */ + public static final String RDF_SEQ = "http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq"; + + /** + * RDF resource that identifies a <code>Bag</code> value. + */ + public static final String RDF_BAG = "http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag"; +} http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/e4dfdf81/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfBeanMeta.java ---------------------------------------------------------------------- diff --git a/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfBeanMeta.java b/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfBeanMeta.java new file mode 100644 index 0000000..1923ac3 --- /dev/null +++ b/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfBeanMeta.java @@ -0,0 +1,61 @@ +// *************************************************************************************************************************** +// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file * +// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file * +// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance * +// * with the License. You may obtain a copy of the License at * +// * * +// * http://www.apache.org/licenses/LICENSE-2.0 * +// * * +// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an * +// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * +// * specific language governing permissions and limitations under the License. * +// *************************************************************************************************************************** +package org.apache.juneau.jena; + +import org.apache.juneau.*; +import org.apache.juneau.jena.annotation.*; + +/** + * Metadata on beans specific to the RDF serializers and parsers pulled from the {@link Rdf @Rdf} annotation on the class. + */ +public class RdfBeanMeta extends BeanMetaExtended { + + // RDF related fields + private final BeanPropertyMeta beanUriProperty; // Bean property that identifies the URI of the bean. + + /** + * Constructor. + * + * @param beanMeta The metadata on the bean that this metadata applies to. + */ + public RdfBeanMeta(BeanMeta<?> beanMeta) { + super(beanMeta); + + BeanPropertyMeta t_beanUriProperty = null; + for (BeanPropertyMeta p : beanMeta.getPropertyMetas()) { + RdfBeanPropertyMeta bpm = p.getExtendedMeta(RdfBeanPropertyMeta.class); + if (bpm.isBeanUri()) + t_beanUriProperty = p; + } + + this.beanUriProperty = t_beanUriProperty; + } + + /** + * Returns <jk>true</jk> if one of the properties on this bean is annotated with {@link Rdf#beanUri()} as <jk>true</jk> + * + * @return <jk>true</jk> if there is a URI property associated with this bean. + */ + public boolean hasBeanUri() { + return beanUriProperty != null; + } + + /** + * Returns the bean property marked as the URI for the bean (annotated with {@link Rdf#beanUri()} as <jk>true</jk>). + * + * @return The URI property, or <jk>null</jk> if no URI property exists on this bean. + */ + public BeanPropertyMeta getBeanUriProperty() { + return beanUriProperty; + } +} http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/e4dfdf81/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfBeanPropertyMeta.java ---------------------------------------------------------------------- diff --git a/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfBeanPropertyMeta.java b/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfBeanPropertyMeta.java new file mode 100644 index 0000000..9dedfb4 --- /dev/null +++ b/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfBeanPropertyMeta.java @@ -0,0 +1,93 @@ +// *************************************************************************************************************************** +// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file * +// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file * +// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance * +// * with the License. You may obtain a copy of the License at * +// * * +// * http://www.apache.org/licenses/LICENSE-2.0 * +// * * +// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an * +// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * +// * specific language governing permissions and limitations under the License. * +// *************************************************************************************************************************** +package org.apache.juneau.jena; + +import static org.apache.juneau.jena.RdfCollectionFormat.*; + +import java.util.*; + +import org.apache.juneau.*; +import org.apache.juneau.jena.annotation.*; +import org.apache.juneau.xml.*; + +/** + * Metadata on bean properties specific to the RDF serializers and parsers pulled from the {@link Rdf @Rdf} annotation on the bean property. + */ +public class RdfBeanPropertyMeta extends BeanPropertyMetaExtended { + + private RdfCollectionFormat collectionFormat = DEFAULT; + private Namespace namespace = null; + private boolean isBeanUri; + + /** + * Constructor. + * + * @param bpm The metadata of the bean property of this additional metadata. + */ + public RdfBeanPropertyMeta(BeanPropertyMeta bpm) { + super(bpm); + + List<Rdf> rdfs = bpm.findAnnotations(Rdf.class); + List<RdfSchema> schemas = bpm.findAnnotations(RdfSchema.class); + + for (Rdf rdf : rdfs) { + if (collectionFormat == DEFAULT) + collectionFormat = rdf.collectionFormat(); + if (rdf.beanUri()) + isBeanUri = true; + } + + namespace = RdfUtils.findNamespace(rdfs, schemas); + } + + /** + * Returns the RDF collection format of this property from the {@link Rdf#collectionFormat} annotation on this bean property. + * + * @return The RDF collection format, or {@link RdfCollectionFormat#DEFAULT} if annotation not specified. + */ + protected RdfCollectionFormat getCollectionFormat() { + return collectionFormat; + } + + /** + * Returns the RDF namespace associated with this bean property. + * <p> + * Namespace is determined in the following order: + * <ol> + * <li>{@link Rdf#prefix()} annotation defined on bean property field. + * <li>{@link Rdf#prefix()} annotation defined on bean getter. + * <li>{@link Rdf#prefix()} annotation defined on bean setter. + * <li>{@link Rdf#prefix()} annotation defined on bean. + * <li>{@link Rdf#prefix()} annotation defined on bean package. + * <li>{@link Rdf#prefix()} annotation defined on bean superclasses. + * <li>{@link Rdf#prefix()} annotation defined on bean superclass packages. + * <li>{@link Rdf#prefix()} annotation defined on bean interfaces. + * <li>{@link Rdf#prefix()} annotation defined on bean interface packages. + * </ol> + * + * @return The namespace associated with this bean property, or <jk>null</jk> if no namespace is + * associated with it. + */ + public Namespace getNamespace() { + return namespace; + } + + /** + * Returns <jk>true</jk> if this bean property is marked with {@link Rdf#beanUri()} as <jk>true</jk>. + * + * @return <jk>true</jk> if this bean property is marked with {@link Rdf#beanUri()} as <jk>true</jk>. + */ + public boolean isBeanUri() { + return isBeanUri; + } +} http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/e4dfdf81/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfClassMeta.java ---------------------------------------------------------------------- diff --git a/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfClassMeta.java b/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfClassMeta.java new file mode 100644 index 0000000..44331ad --- /dev/null +++ b/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfClassMeta.java @@ -0,0 +1,87 @@ +// *************************************************************************************************************************** +// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file * +// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file * +// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance * +// * with the License. You may obtain a copy of the License at * +// * * +// * http://www.apache.org/licenses/LICENSE-2.0 * +// * * +// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an * +// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * +// * specific language governing permissions and limitations under the License. * +// *************************************************************************************************************************** +package org.apache.juneau.jena; + +import java.util.*; + +import org.apache.juneau.*; +import org.apache.juneau.internal.*; +import org.apache.juneau.jena.annotation.*; +import org.apache.juneau.xml.*; + +/** + * Metadata on classes specific to the RDF serializers and parsers pulled from the {@link Rdf @Rdf} annotation on the class. + */ +public class RdfClassMeta extends ClassMetaExtended { + + private final Rdf rdf; + private final RdfCollectionFormat collectionFormat; + private final Namespace namespace; + + /** + * Constructor. + * + * @param cm The class that this annotation is defined on. + */ + public RdfClassMeta(ClassMeta<?> cm) { + super(cm); + Class<?> c = getInnerClass(); + this.rdf = ReflectionUtils.getAnnotation(Rdf.class, c); + if (rdf != null) { + collectionFormat = rdf.collectionFormat(); + } else { + collectionFormat = RdfCollectionFormat.DEFAULT; + } + List<Rdf> rdfs = ReflectionUtils.findAnnotations(Rdf.class, c); + List<RdfSchema> schemas = ReflectionUtils.findAnnotations(RdfSchema.class, c); + this.namespace = RdfUtils.findNamespace(rdfs, schemas); + } + + /** + * Returns the {@link Rdf} annotation defined on the class. + * + * @return The value of the {@link Rdf} annotation, or <jk>null</jk> if annotation is not specified. + */ + protected Rdf getAnnotation() { + return rdf; + } + + /** + * Returns the {@link Rdf#collectionFormat()} annotation defined on the class. + * + * @return The value of the {@link Rdf#collectionFormat()} annotation, or <jk>null</jk> if annotation is not specified. + */ + protected RdfCollectionFormat getCollectionFormat() { + return collectionFormat; + } + + /** + * Returns the RDF namespace associated with this class. + * <p> + * Namespace is determined in the following order: + * <ol> + * <li>{@link Rdf#prefix()} annotation defined on class. + * <li>{@link Rdf#prefix()} annotation defined on package. + * <li>{@link Rdf#prefix()} annotation defined on superclasses. + * <li>{@link Rdf#prefix()} annotation defined on superclass packages. + * <li>{@link Rdf#prefix()} annotation defined on interfaces. + * <li>{@link Rdf#prefix()} annotation defined on interface packages. + * </ol> + * + * @return The namespace associated with this class, or <jk>null</jk> if no namespace is + * associated with it. + */ + protected Namespace getNamespace() { + return namespace; + } +} http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/e4dfdf81/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfCollectionFormat.java ---------------------------------------------------------------------- diff --git a/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfCollectionFormat.java b/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfCollectionFormat.java new file mode 100644 index 0000000..70984b2 --- /dev/null +++ b/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfCollectionFormat.java @@ -0,0 +1,53 @@ +// *************************************************************************************************************************** +// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file * +// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file * +// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance * +// * with the License. You may obtain a copy of the License at * +// * * +// * http://www.apache.org/licenses/LICENSE-2.0 * +// * * +// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an * +// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * +// * specific language governing permissions and limitations under the License. * +// *************************************************************************************************************************** +package org.apache.juneau.jena; + +import org.apache.juneau.jena.annotation.*; + +/** + * Used in conjunction with the {@link Rdf#collectionFormat() @Rdf.collectionFormat()} annotation to fine-tune how + * classes, beans, and bean properties are serialized, particularly collections. + */ +public enum RdfCollectionFormat { + + /** + * Default formatting (default). + * <p> + * Inherit formatting from parent class or parent package. + * If no formatting specified at any level, default is {@link #SEQ}. + */ + DEFAULT, + + /** + * Causes collections and arrays to be rendered as RDF sequences. + */ + SEQ, + + /** + * Causes collections and arrays to be rendered as RDF bags. + */ + BAG, + + /** + * Causes collections and arrays to be rendered as RDF lists. + */ + LIST, + + /** + * Causes collections and arrays to be rendered as multi-valued RDF properties instead of sequences. + * <p> + * Note that enabling this setting will cause order of elements in the collection to be lost. + */ + MULTI_VALUED; + +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/e4dfdf81/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfCommonContext.java ---------------------------------------------------------------------- diff --git a/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfCommonContext.java b/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfCommonContext.java new file mode 100644 index 0000000..bd99d10 --- /dev/null +++ b/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfCommonContext.java @@ -0,0 +1,753 @@ +// *************************************************************************************************************************** +// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file * +// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file * +// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance * +// * with the License. You may obtain a copy of the License at * +// * * +// * http://www.apache.org/licenses/LICENSE-2.0 * +// * * +// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an * +// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * +// * specific language governing permissions and limitations under the License. * +// *************************************************************************************************************************** +package org.apache.juneau.jena; + +import java.util.*; + +import org.apache.juneau.jena.annotation.*; +import org.apache.juneau.xml.*; +import org.apache.juneau.xml.annotation.*; + +/** + * Configurable properties common to both the {@link RdfSerializer} and {@link RdfParser} classes. + * + * <h6 class='topic' id='ConfigProperties'>Configurable properties common to the RDF serializers and parsers</h6> + * <table class='styled' style='border-collapse: collapse;'> + * <tr><th>Setting name</th><th>Description</th><th>Data type</th><th>Default value</th></tr> + * <tr> + * <td>{@link #RDF_language}</td> + * <td>RDF language.</td> + * <td><code>String</code></td> + * <td><js>"RDF/XML-ABBREV"</js></td> + * </tr> + * <tr> + * <td>{@link #RDF_juneauNs}</td> + * <td>XML namespace for Juneau properties.</td> + * <td>{@link Namespace}</td> + * <td><code>{j:<js>'http://www.apache.org/juneau/'</js>}</code></td> + * </tr> + * <tr> + * <td>{@link #RDF_juneauBpNs}</td> + * <td>Default XML namespace for bean properties.</td> + * <td>{@link Namespace}</td> + * <td><code>{j:<js>'http://www.apache.org/juneaubp/'</js>}</code></td> + * </tr> + * <tr> + * <td>{@link #RDF_useXmlNamespaces}</td> + * <td>Reuse XML namespaces when RDF namespaces not specified.</td> + * <td><code>Boolean</code></td> + * <td><jk>true</jk></td> + * </tr> + * <tr> + * <td>{@link #RDF_arp_iriRules}</td> + * <td>RDF/XML property: <code>iri_rules</code>.</td> + * <td><code>String</code></td> + * <td><js>"lax"</js></td> + * </tr> + * <tr> + * <td>{@link #RDF_arp_errorMode}</td> + * <td>RDF/XML ARP property: <code>error-mode</code>.</td> + * <td><code>String</code></td> + * <td><js>"lax"</js></td> + * </tr> + * <tr> + * <td>{@link #RDF_arp_embedding}</td> + * <td>RDF/XML ARP property: <code>embedding</code>.</td> + * <td><code>Boolean</code></td> + * <td><jk>false</jk></td> + * </tr> + * <tr> + * <td>{@link #RDF_arp_err_}</td> + * <td>RDF/XML ARP property: <code>ERR_xxx</code>.</td> + * <td><code>String</code></td> + * <td></td> + * </tr> + * <tr> + * <td>{@link #RDF_arp_warn_}</td> + * <td>RDF/XML ARP property: <code>WARN_xxx</code>.</td> + * <td><code>String</code></td> + * <td></td> + * </tr> + * <tr> + * <td>{@link #RDF_arp_ign_}</td> + * <td>RDF/XML ARP property: <code>IGN_xxx</code>.</td> + * <td><code>String</code></td> + * <td></td> + * </tr> + * <tr> + * <td>{@link #RDF_rdfxml_xmlBase}</td> + * <td>RDF/XML property: <code>xmlbase</code>.</td> + * <td><code>String</code></td> + * <td><jk>null</jk></td> + * </tr> + * <tr> + * <td>{@link #RDF_rdfxml_longId}</td> + * <td>RDF/XML property: <code>longId</code>.</td> + * <td><code>Boolean</code></td> + * <td><jk>false</jk></td> + * </tr> + * <tr> + * <td>{@link #RDF_rdfxml_allowBadUris}</td> + * <td>RDF/XML property: <code>allowBadURIs</code>.</td> + * <td><code>Boolean</code></td> + * <td><jk>false</jk></td> + * </tr> + * <tr> + * <td>{@link #RDF_rdfxml_relativeUris}</td> + * <td>RDF/XML property: <code>relativeURIs</code>.</td> + * <td><code>String</code></td> + * <td><js>"same-document, absolute, relative, parent"</js></td> + * </tr> + * <tr> + * <td>{@link #RDF_rdfxml_showXmlDeclaration}</td> + * <td>RDF/XML property: <code>showXmlDeclaration</code>.</td> + * <td><code>String</code></td> + * <td><js>"default"</js></td> + * </tr> + * <tr> + * <td>{@link #RDF_rdfxml_showDoctypeDeclaration}</td> + * <td>RDF/XML property: <code>showDoctypeDeclaration</code>.</td> + * <td><code>Boolean</code></td> + * <td><jk>true</jk></td> + * </tr> + * <tr> + * <td>{@link #RDF_rdfxml_tab}</td> + * <td>RDF/XML property: <code>tab</code>.</td> + * <td><code>Integer</code></td> + * <td><code>2</code></td> + * </tr> + * <tr> + * <td>{@link #RDF_rdfxml_attributeQuoteChar}</td> + * <td>RDF/XML property: <code>attributeQuoteChar</code>.</td> + * <td><code>Character</code></td> + * <td><js>'"'</js></td> + * </tr> + * <tr> + * <td>{@link #RDF_rdfxml_blockRules}</td> + * <td>RDF/XML property: <code>blockRules</code>.</td> + * <td><code>String</code></td> + * <td><js>""</js></td> + * </tr> + * <tr> + * <td>{@link #RDF_n3_minGap}</td> + * <td>N3/Turtle property: <code>minGap</code>.</td> + * <td><code>Integer</code></td> + * <td><code>1</code></td> + * </tr> + * <tr> + * <td>{@link #RDF_n3_objectLists}</td> + * <td>N3/Turtle property: <code>objectLists</code>.</td> + * <td><code>Boolean</code></td> + * <td><jk>true</jk></td> + * </tr> + * <tr> + * <td>{@link #RDF_n3_subjectColumn}</td> + * <td>N3/Turtle property: <code>subjectColumn</code>.</td> + * <td>code>Integer</code></td> + * <td>indent column</td> + * </tr> + * <tr> + * <td>{@link #RDF_n3_propertyColumn}</td> + * <td>N3/Turtle property: <code>propertyColumn</code>.</td> + * <td><code>Integer</code></td> + * <td><code>8</code></td> + * </tr> + * <tr> + * <td>{@link #RDF_n3_indentProperty}</td> + * <td>N3/Turtle property: <code>indentProperty</code>.</td> + * <td><code>Integer</code></td> + * <td><code>6</code></td> + * </tr> + * <tr> + * <td>{@link #RDF_n3_widePropertyLen}</td> + * <td>N3/Turtle property: <code>widePropertyLen</code>.</td> + * <td><code>Integer</code></td> + * <td><code>20</code></td> + * </tr> + * <tr> + * <td>{@link #RDF_n3_abbrevBaseUri}</td> + * <td>N3/Turtle property: <code>abbrevBaseURI</code>.</td> + * <td><code>Boolean</code></td> + * <td><jk>true</jk></td> + * </tr> + * <tr> + * <td>{@link #RDF_n3_usePropertySymbols}</td> + * <td>N3/Turtle property: <code>usePropertySymbols</code>.</td> + * <td><code>Boolean</code></td> + * <td><jk>true</jk></td> + * </tr> + * <tr> + * <td>{@link #RDF_n3_useTripleQuotedStrings}</td> + * <td>N3/Turtle property: <code>useTripleQuotedStrings</code>.</td> + * <td><code>Boolean</code></td> + * <td><jk>true</jk></td> + * </tr> + * <tr> + * <td>{@link #RDF_n3_useDoubles}</td> + * <td>N3/Turtle property: <code>useDoubles</code>.</td> + * <td><code>Boolean</code></td> + * <td><jk>true</jk></td> + * </tr> + * <tr> + * <td>{@link #RDF_collectionFormat}</td> + * <td>RDF format for representing collections and arrays.</td> + * <td><code>String</code></td> + * <td><js>"DEFAULT"</js></td> + * </tr> + * <tr> + * <td>{@link #RDF_looseCollections}</td> + * <td>Collections should be serialized and parsed as loose collections.</td> + * <td><code>Boolean</code></td> + * <td><jk>false</jk></td> + * </tr> + * </table> + */ +@SuppressWarnings("serial") +public interface RdfCommonContext { + + /** + * Maps RDF writer names to property prefixes that apply to them. + */ + final static Map<String,String> LANG_PROP_MAP = new HashMap<String,String>() {{ + put("RDF/XML","rdfXml."); + put("RDF/XML-ABBREV","rdfXml."); + put("N3","n3."); + put("N3-PP","n3."); + put("N3-PLAIN","n3."); + put("N3-TRIPLES","n3."); + put("TURTLE","n3."); + put("N-TRIPLE","ntriple."); + }}; + + /** + * <b>Configuration property:</b> RDF language. + * <p> + * <ul> + * <li><b>Name:</b> <js>"Rdf.language"</js> + * <li><b>Data type:</b> <code>String</code> + * <li><b>Default:</b> <js>"RDF/XML-ABBREV"</js> + * </ul> + * <p> + * Can be any of the following: + * <ul class='spaced-list'> + * <li><js>"RDF/XML"</js> + * <li><js>"RDF/XML-ABBREV"</js> + * <li><js>"N-TRIPLE"</js> + * <li><js>"N3"</js> - General name for the N3 writer. + * Will make a decision on exactly which writer to use (pretty writer, plain writer or simple writer) when created. + * Default is the pretty writer but can be overridden with system property <code>com.hp.hpl.jena.n3.N3JenaWriter.writer</code>. + * <li><js>"N3-PP"</js> - Name of the N3 pretty writer. + * The pretty writer uses a frame-like layout, with prefixing, clustering like properties and embedding one-referenced bNodes. + * <li><js>"N3-PLAIN"</js> - Name of the N3 plain writer. + * The plain writer writes records by subject. + * <li><js>"N3-TRIPLES"</js> - Name of the N3 triples writer. + * This writer writes one line per statement, like N-Triples, but does N3-style prefixing. + * <li><js>"TURTLE"</js> - Turtle writer. + * http://www.dajobe.org/2004/01/turtle/ + * </ul> + */ + public static final String RDF_language = "Rdf.language"; + + /** + * <b>Configuration property:</b> XML namespace for Juneau properties. + * <p> + * <ul> + * <li><b>Name:</b> <js>"Rdf.juneauNs"</js> + * <li><b>Data type:</b> {@link Namespace} + * <li><b>Default:</b> <code>{j:<js>'http://www.apache.org/juneau/'</js>}</code> + * </ul> + */ + public static final String RDF_juneauNs = "Rdf.juneauNs"; + + /** + * <b>Configuration property:</b> Default XML namespace for bean properties. + * <p> + * <ul> + * <li><b>Name:</b> <js>"Rdf.juneauBpNs"</js> + * <li><b>Data type:</b> {@link Namespace} + * <li><b>Default:</b> <code>{j:<js>'http://www.apache.org/juneaubp/'</js>}</code> + * </ul> + */ + public static final String RDF_juneauBpNs = "Rdf.juneauBpNs"; + + /** + * <b>Configuration property:</b> Reuse XML namespaces when RDF namespaces not specified. + * <p> + * <ul> + * <li><b>Name:</b> <js>"Rdf.useXmlNamespaces"</js> + * <li><b>Data type:</b> <code>Boolean</code> + * <li><b>Default:</b> <jk>true</jk> + * </ul> + * <p> + * When specified, namespaces defined using {@link XmlNs} and {@link Xml} will be inherited by the RDF serializers. + * Otherwise, namespaces will be defined using {@link RdfNs} and {@link Rdf}. + */ + public static final String RDF_useXmlNamespaces = "Rdf.useXmlNamespaces"; + + /** + * <b>Configuration property:</b> RDF/XML property: <code>iri_rules</code>. + * <p> + * <ul> + * <li><b>Name:</b> <js>"Rdf.jena.rdfXml.iri-rules"</js> + * <li><b>Data type:</b> <code>String</code> + * <li><b>Default:</b> <js>"lax"</js> + * </ul> + * <p> + * Set the engine for checking and resolving. + * <p> + * Possible values: + * <ul class='spaced-list'> + * <li><js>"lax"</js> - The rules for RDF URI references only, which does permit spaces although the use of spaces is not good practice. + * <li><js>"strict"</js> - Sets the IRI engine with rules for valid IRIs, XLink and RDF; it does not permit spaces in IRIs. + * <li><js>"iri"</js> - Sets the IRI engine to IRI (<a href='http://www.ietf.org/rfc/rfc3986.txt'>RFC 3986</a>, <a href='http://www.ietf.org/rfc/rfc3987.txt'>RFC 3987</a>). + * </ul> + */ + public static final String RDF_arp_iriRules = "Rdf.jena.rdfXml.iri-rules"; + + /** + * <b>Configuration property:</b> RDF/XML ARP property: <code>error-mode</code>. + * <p> + * <ul> + * <li><b>Name:</b> <js>"Rdf.jena.rdfXml.error-mode"</js> + * <li><b>Data type:</b> <code>String</code> + * <li><b>Default:</b> <js>"lax"</js> + * </ul> + * <p> + * This allows a coarse-grained approach to control of error handling. + * <p> + * Possible values: + * <ul> + * <li><js>"default"</js> + * <li><js>"lax"</js> + * <li><js>"strict"</js> + * <li><js>"strict-ignore"</js> + * <li><js>"strict-warning"</js> + * <li><js>"strict-error"</js> + * <li><js>"strict-fatal"</js> + * </ul> + * <p> + * See also: + * <ul class='spaced-list'> + * <li><a href='http://jena.sourceforge.net/javadoc/com/hp/hpl/jena/rdf/arp/ARPOptions.html#setDefaultErrorMode()'>ARPOptions.setDefaultErrorMode()</a> + * <li><a href='http://jena.sourceforge.net/javadoc/com/hp/hpl/jena/rdf/arp/ARPOptions.html#setLaxErrorMode()'>ARPOptions.setLaxErrorMode()</a> + * <li><a href='http://jena.sourceforge.net/javadoc/com/hp/hpl/jena/rdf/arp/ARPOptions.html#setStrictErrorMode()'>ARPOptions.setStrictErrorMode()</a> + * <li><a href='http://jena.sourceforge.net/javadoc/com/hp/hpl/jena/rdf/arp/ARPOptions.html#setStrictErrorMode(int)'>ARPOptions.setStrictErrorMode(int)</a> + * </ul> + */ + public static final String RDF_arp_errorMode = "Rdf.jena.rdfXml.error-mode"; + + /** + * <b>Configuration property:</b> RDF/XML ARP property: <code>embedding</code>. + * <p> + * <ul> + * <li><b>Name:</b> <js>"Rdf.jena.rdfXml.embedding"</js> + * <li><b>Data type:</b> <code>Boolean</code> + * <li><b>Default:</b> <jk>false</jk> + * </ul> + * <p> + * Sets ARP to look for RDF embedded within an enclosing XML document. + * <p> + * See also: + * <ul class='spaced-list'> + * <li><a href='http://jena.sourceforge.net/javadoc/com/hp/hpl/jena/rdf/arp/ARPOptions.html#setEmbedding(boolean)'>ARPOptions.setEmbedding(boolean)</a> + * </ul> + */ + public static final String RDF_arp_embedding = "Rdf.jena.rdfXml.embedding"; + + /** + * <b>Configuration property:</b> RDF/XML ARP property: <code>ERR_xxx</code>. + * <p> + * <ul> + * <li><b>Name:</b> <js>"Rdf.jena.rdfXml.ERR_"</js> + * <li><b>Data type:</b> <code>String</code> + * </ul> + * <p> + * Provides fine-grained control over detected error conditions. + * <p> + * Possible values: + * <ul> + * <li><js>"EM_IGNORE"</js> + * <li><js>"EM_WARNING"</js> + * <li><js>"EM_ERROR"</js> + * <li><js>"EM_FATAL"</js> + * </ul> + * <p> + * See also: + * <ul class='spaced-list'> + * <li><a href='http://jena.sourceforge.net/javadoc/com/hp/hpl/jena/rdf/arp/ARPErrorNumbers.html'>ARPErrorNumbers</a> + * <li><a href='http://jena.sourceforge.net/javadoc/com/hp/hpl/jena/rdf/arp/ARPOptions.html#setErrorMode(int,%20int)'>ARPOptions.setErrorMode(int, int)</a> + * </ul> + */ + public static final String RDF_arp_err_ = "Rdf.jena.rdfXml.ERR_"; + + /** + * <b>Configuration property:</b> RDF/XML ARP property: <code>WARN_xxx</code>. + * <p> + * <ul> + * <li><b>Name:</b> <js>"Rdf.jena.rdfXml.WARN_"</js> + * <li><b>Data type:</b> <code>String</code> + * </ul> + * <p> + * See {@link #RDF_arp_err_} for details. + */ + public static final String RDF_arp_warn_ = "Rdf.jena.rdfXml.WARN_"; + + /** + * RDF/XML ARP property: <code>IGN_xxx</code>. + * <p> + * <ul> + * <li><b>Name:</b> <js>"Rdf.jena.rdfXml.IGN_"</js> + * <li><b>Data type:</b> <code>String</code> + * </ul> + * <p> + * See {@link #RDF_arp_err_} for details. + */ + public static final String RDF_arp_ign_ = "Rdf.jena.rdfXml.IGN_"; + + /** + * <b>Configuration property:</b> RDF/XML property: <code>xmlbase</code>. + * <p> + * <ul> + * <li><b>Name:</b> <js>"Rdf.jena.rdfXml.xmlbase"</js> + * <li><b>Data type:</b> <code>String</code> + * <li><b>Default:</b> <jk>null</jk> + * </ul> + * <p> + * The value to be included for an <xa>xml:base</xa> attribute on the root element in the file. + */ + public static final String RDF_rdfxml_xmlBase = "Rdf.jena.rdfXml.xmlbase"; + + /** + * <b>Configuration property:</b> RDF/XML property: <code>longId</code>. + * <p> + * <ul> + * <li><b>Name:</b> <js>"Rdf.jena.rdfXml.longId"</js> + * <li><b>Data type:</b> <code>Boolean</code> + * <li><b>Default:</b> <jk>false</jk> + * </ul> + * <p> + * Whether to use long ID's for anon resources. + * Short ID's are easier to read, but can run out of memory on very large models. + */ + public static final String RDF_rdfxml_longId = "Rdf.jena.rdfXml.longId"; + + /** + * <b>Configuration property:</b> RDF/XML property: <code>allowBadURIs</code>. + * <p> + * <ul> + * <li><b>Name:</b> <js>"Rdf.jena.rdfXml.allowBadURIs"</js> + * <li><b>Data type:</b> <code>Boolean</code> + * <li><b>Default:</b> <jk>false</jk> + * </ul> + * <p> + * URIs in the graph are, by default, checked prior to serialization. + */ + public static final String RDF_rdfxml_allowBadUris = "Rdf.jena.rdfXml.allowBadURIs"; + + /** + * <b>Configuration property:</b> RDF/XML property: <code>relativeURIs</code>. + * <p> + * <ul> + * <li><b>Name:</b> <js>"Rdf.jena.rdfXml.relativeURIs"</js> + * <li><b>Data type:</b> <code>String</code> + * <li><b>Default:</b> <js>"same-document, absolute, relative, parent"</js> + * </ul> + * <p> + * What sort of relative URIs should be used. + * <p> + * A comma separate list of options: + * <ul class='spaced-list'> + * <li><js>"same-document"</js> - Same-document references (e.g. <js>""</js> or <js>"#foo"</js>) + * <li><js>"network"</js> - Network paths (e.g. <js>"//example.org/foo"</js> omitting the URI scheme) + * <li><js>"absolute"</js> - Absolute paths (e.g. <js>"/foo"</js> omitting the scheme and authority) + * <li><js>"relative"</js> - Relative path not begining in <js>"../"</js> + * <li><js>"parent"</js> - Relative path begining in <js>"../"</js> + * <li><js>"grandparent"</js> - Relative path begining in <js>"../../"</js> + * </ul> + * <p> + * The default value is <js>"same-document, absolute, relative, parent"</js>. + * To switch off relative URIs use the value <js>""</js>. + * Relative URIs of any of these types are output where possible if and only if the option has been specified. + */ + public static final String RDF_rdfxml_relativeUris = "Rdf.jena.rdfXml.relativeURIs"; + + /** + * <b>Configuration property:</b> RDF/XML property: <code>showXmlDeclaration</code>. + * <p> + * <ul> + * <li><b>Name:</b> <js>"Rdf.jena.rdfXml.showXmlDeclaration"</js> + * <li><b>Data type:</b> <code>String</code> + * <li><b>Default:</b> <js>"default"</js> + * </ul> + * <p> + * Possible values: + * <ul class='spaced-list'> + * <li><js>"true"</js> - Add XML Declaration to the output. + * <li><js>"false"</js> - Don't add XML Declaration to the output. + * <li><js>"default"</js> - Only add an XML Declaration when asked to write to an <code>OutputStreamWriter</code> that uses some encoding other than <code>UTF-8</code> or <code>UTF-16</code>. + * In this case the encoding is shown in the XML declaration. + * </ul> + */ + public static final String RDF_rdfxml_showXmlDeclaration = "Rdf.jena.rdfXml.showXmlDeclaration"; + + /** + * <b>Configuration property:</b> RDF/XML property: <code>showDoctypeDeclaration</code>. + * <p> + * <ul> + * <li><b>Name:</b> <js>"Rdf.jena.rdfXml.showDoctypeDeclaration"</js> + * <li><b>Data type:</b> <code>Boolean</code> + * <li><b>Default:</b> <jk>true</jk> + * </ul> + * <p> + * If true, an XML Doctype declaration is included in the output. + * This declaration includes a <code>!ENTITY</code> declaration for each prefix mapping in the model, and any attribute value that starts with the URI of that mapping is written as starting with the corresponding entity invocation. + */ + public static final String RDF_rdfxml_showDoctypeDeclaration = "Rdf.jena.rdfXml.showDoctypeDeclaration"; + + /** + * <b>Configuration property:</b> RDF/XML property: <code>tab</code>. + * <p> + * <ul> + * <li><b>Name:</b> <js>"Rdf.jena.rdfXml.tab"</js> + * <li><b>Data type:</b> <code>Integer</code> + * <li><b>Default:</b> <code>2</code> + * </ul> + * <p> + * The number of spaces with which to indent XML child elements. + */ + public static final String RDF_rdfxml_tab = "Rdf.jena.rdfXml.tab"; + + /** + * <b>Configuration property:</b> RDF/XML property: <code>attributeQuoteChar</code>. + * <p> + * <ul> + * <li><b>Name:</b> <js>"Rdf.jena.rdfXml.attributeQuoteChar"</js> + * <li><b>Data type:</b> <code>Character</code> + * <li><b>Default:</b> <js>'"'</js> + * </ul> + * <p> + * The XML attribute quote character. + */ + public static final String RDF_rdfxml_attributeQuoteChar = "Rdf.jena.rdfXml.attributeQuoteChar"; + + /** + * <b>Configuration property:</b> RDF/XML property: <code>blockRules</code>. + * <p> + * <ul> + * <li><b>Name:</b> <js>"Rdf.jena.rdfXml.blockRules"</js> + * <li><b>Data type:</b> <code>String</code> + * <li><b>Default:</b> <js>""</js> + * </ul> + * <p> + * A list of <code>Resource</code> or a <code>String</code> being a comma separated list of fragment IDs from <a href='http://www.w3.org/TR/rdf-syntax-grammar'>RDF Syntax Grammar</a> indicating grammar rules that will not be used. + */ + public static final String RDF_rdfxml_blockRules = "Rdf.jena.rdfXml.blockRules"; + + /** + * <b>Configuration property:</b> N3/Turtle property: <code>minGap</code>. + * <p> + * <ul> + * <li><b>Name:</b> <js>"Rdf.jena.n3.minGap"</js> + * <li><b>Data type:</b> <code>Integer</code> + * <li><b>Default:</b> <code>1</code> + * </ul> + * <p> + * Minimum gap between items on a line. + */ + public static final String RDF_n3_minGap = "Rdf.jena.n3.minGap"; + + /** + * <b>Configuration property:</b> N3/Turtle property: <code>objectLists</code>. + * <p> + * <ul> + * <li><b>Name:</b> <js>"Rdf.jena.n3.objectLists"</js> + * <li><b>Data type:</b> <code>Boolean</code> + * <li><b>Default:</b> <jk>true</jk> + * </ul> + * <p> + * Print object lists as comma separated lists. + */ + public static final String RDF_n3_objectLists = "Rdf.jena.n3.objectLists"; + + /** + * <b>Configuration property:</b> N3/Turtle property: <code>subjectColumn</code>. + * <p> + * <ul> + * <li><b>Name:</b> <js>"Rdf.jena.n3.subjectColumn"</js> + * <li><b>Data type:</b> <code>Integer</code> + * <li><b>Default:</b> indentProperty + * </ul> + * <p> + * If the subject is shorter than this value, the first property may go on the same line. + */ + public static final String RDF_n3_subjectColumn = "Rdf.jena.n3.subjectColumn"; + + /** + * <b>Configuration property:</b> N3/Turtle property: <code>propertyColumn</code>. + * <p> + * <ul> + * <li><b>Name:</b> <js>"Rdf.jena.n3.propertyColumn"</js> + * <li><b>Data type:</b> <code>Integer</code> + * <li><b>Default:</b> <code>8</code> + * </ul> + * <p> + * Width of the property column. + */ + public static final String RDF_n3_propertyColumn = "Rdf.jena.n3.propertyColumn"; + + /** + * <b>Configuration property:</b> N3/Turtle property: <code>indentProperty</code>. + * <p> + * <ul> + * <li><b>Name:</b> <js>"Rdf.jena.n3.indentProperty"</js> + * <li><b>Data type:</b> <code>Integer</code> + * <li><b>Default:</b> <code>6</code> + * </ul> + * <p> + * Width to indent properties. + */ + public static final String RDF_n3_indentProperty = "Rdf.jena.n3.indentProperty"; + + /** + * <b>Configuration property:</b> N3/Turtle property: <code>widePropertyLen</code>. + * <p> + * <ul> + * <li><b>Name:</b> <js>"Rdf.jena.n3.widePropertyLen"</js> + * <li><b>Data type:</b> <code>Integer</code> + * <li><b>Default:</b> <code>20</code> + * </ul> + * <p> + * Width of the property column. + * Must be longer than <code>propertyColumn</code>. + */ + public static final String RDF_n3_widePropertyLen = "Rdf.jena.n3.widePropertyLen"; + + /** + * <b>Configuration property:</b> N3/Turtle property: <code>abbrevBaseURI</code>. + * <p> + * <ul> + * <li><b>Name:</b> <js>"Rdf.jena.n3.abbrevBaseURI"</js> + * <li><b>Data type:</b> <code>Boolean</code> + * <li><b>Default:</b> <jk>true</jk> + * </ul> + * <p> + * Control whether to use abbreviations <code><></code> or <code><#></code>. + */ + public static final String RDF_n3_abbrevBaseUri = "Rdf.jena.n3.abbrevBaseURI"; + + /** + * <b>Configuration property:</b> N3/Turtle property: <code>usePropertySymbols</code>. + * <p> + * <ul> + * <li><b>Name:</b> <js>"Rdf.jena.n3.usePropertySymbols"</js> + * <li><b>Data type:</b> <code>Boolean</code> + * <li><b>Default:</b> <jk>true</jk> + * </ul> + * <p> + * Control whether to use <code>a</code>, <code>=</code> and <code>=></code> in output + */ + public static final String RDF_n3_usePropertySymbols = "Rdf.jena.n3.usePropertySymbols"; + + /** + * <b>Configuration property:</b> N3/Turtle property: <code>useTripleQuotedStrings</code>. + * <p> + * <ul> + * <li><b>Name:</b> <js>"Rdf.jena.n3.useTripleQuotedStrings"</js> + * <li><b>Data type:</b> <code>Boolean</code> + * <li><b>Default:</b> <jk>true</jk> + * </ul> + * <p> + * Allow the use of <code>"""</code> to delimit long strings. + */ + public static final String RDF_n3_useTripleQuotedStrings = "Rdf.jena.n3.useTripleQuotedStrings"; + + /** + * <b>Configuration property:</b> N3/Turtle property: <code>useDoubles</code>. + * <p> + * <ul> + * <li><b>Name:</b> <js>"Rdf.jena.n3.useDoubles"</js> + * <li><b>Data type:</b> <code>Boolean</code> + * <li><b>Default:</b> <jk>true</jk> + * </ul> + * <p> + * Allow the use doubles as <code>123.456</code>. + */ + public static final String RDF_n3_useDoubles = "Rdf.jena.n3.useDoubles"; + + /** + * <b>Configuration property:</b> RDF format for representing collections and arrays. + * <p> + * <ul> + * <li><b>Name:</b> <js>"Rdf.collectionFormat"</js> + * <li><b>Data type:</b> <code>String</code> + * <li><b>Default:</b> <js>"DEFAULT"</js> + * </ul> + * <p> + * Possible values: + * <ul class='spaced-list'> + * <li><js>"DEFAULT"</js> - Default format. The default is an RDF Sequence container. + * <li><js>"SEQ"</js> - RDF Sequence container. + * <li><js>"BAG"</js> - RDF Bag container. + * <li><js>"LIST"</js> - RDF List container. + * <li><js>"MULTI_VALUED"</js> - Multi-valued properties. + * </ul> + * </p> + * <p> + * Important Note: If you use <js>"BAG"</js> or <js>"MULTI_VALUED"</js>, the order of the elements + * in the collection will get lost. + */ + public static final String RDF_collectionFormat = "Rdf.collectionFormat"; + + /** + * <b>Configuration property:</b> Collections should be serialized and parsed as loose collections. + * <p> + * <ul> + * <li><b>Name:</b> <js>"Rdf.looseCollections"</js> + * <li><b>Data type:</b> <code>Boolean</code> + * <li><b>Default:</b> <jk>false</jk> + * </ul> + * <p> + * When specified, collections of resources are handled as loose collections of resources in RDF instead of + * resources that are children of an RDF collection (e.g. Sequence, Bag). + * <p> + * Note that this setting is specialized for RDF syntax, and is incompatible with the concept of + * losslessly representing POJO models, since the tree structure of these POJO models are lost + * when serialized as loose collections. + * <p> + * This setting is typically only useful if the beans being parsed into do not have a bean property + * annotated with {@link Rdf#beanUri @Rdf(beanUri=true)}. + * + * <h6 class='topic'>Example:</h6> + * <p class='bcode'> + * WriterSerializer s = <jk>new</jk> RdfSerializer.XmlAbbrev().setProperty(<jsf>RDF_looseCollection</jsf>, <jk>true</jk>); + * ReaderParser p = <jk>new</jk> RdfParser.Xml().setProperty(<jsf>RDF_looseCollection</jsf>, <jk>true</jk>); + * + * List<MyBean> l = createListOfMyBeans(); + * + * <jc>// Serialize to RDF/XML as loose resources</jc> + * String rdfXml = s.serialize(l); + * + * <jc>// Parse back into a Java collection</jc> + * l = p.parseCollection(rdfXml, LinkedList.<jk>class</jk>, MyBean.<jk>class</jk>); + * + * MyBean[] b = createArrayOfMyBeans(); + * + * <jc>// Serialize to RDF/XML as loose resources</jc> + * String rdfXml = s.serialize(b); + * + * <jc>// Parse back into a bean array</jc> + * b = p.parse(rdfXml, MyBean[].<jk>class</jk>); + * </p> + */ + public static final String RDF_looseCollections = "Rdf.looseCollections"; +}
