Commit graph

424 commits

Author SHA1 Message Date
Marcel Otto 25b7239843 Add RDF.NQuads.Decoder.decode_from_stream/2 2020-11-04 16:51:24 +01:00
Marcel Otto b4f0ae074c Add RDF.NTriples.Decoder.decode_from_stream/2 2020-11-04 16:32:17 +01:00
Marcel Otto e3454f73ce Fix dialyzer warning 2020-11-02 15:59:14 +01:00
Marcel Otto 8d98461e0b Change Inspect form for RDF data structures to be Turtle-based 2020-11-02 15:17:18 +01:00
Marcel Otto 929e2a8c81 Use RDF.PrefixMap.prefixed_name/2 in Turtle encoder 2020-11-02 02:05:23 +01:00
Marcel Otto 8e74e9a9d2 Fix some of the BlankNode representations to be Turtle-serializable 2020-11-01 04:14:30 +01:00
Marcel Otto 3ca4207a14 Add test of RDF.IRI.merge/2 with fragments 2020-11-01 04:03:02 +01:00
Marcel Otto ddb3d365bc Add tests for RDF.BlankNode.new/1 2020-11-01 02:25:25 +01:00
Marcel Otto 15002a0bbb Add RDF.Dataset.prefixes/1 2020-10-28 11:51:00 +01:00
Marcel Otto 29a860d969 Allow vocabulary namespace modules as base for Turtle encoder 2020-10-28 11:36:43 +01:00
Marcel Otto 4f095b8d47 Add RDF.PrefixMap.put/3 2020-10-21 12:59:20 +02:00
Marcel Otto 352b8ef1a8 Use also the :context opt and implicit PropertyMap formats in values/2 2020-10-13 11:50:02 +02:00
Marcel Otto cafba9f61f Add support for RDF.PropertyMaps in BGP and path queries 2020-10-13 10:43:05 +02:00
Marcel Otto d3c6336782 Fix bug with BGP queries provided as maps 2020-10-12 23:02:56 +02:00
Marcel Otto eef64b9253 Add support for adding terms of a vocab namespace to RDF.PropertyMap
For now only with RDF.PropertyMap.add/2 on purpose, since we want to
enforce a conscious usage of this feature, as put/2 would silently
overwrite terms.
2020-10-11 11:42:30 +02:00
Marcel Otto 5d9ddeb7fe Add tests for merging RDF.PropertyMaps
Implementation wasn't needed, since the merge already works via the
Enumerable protocol implementation.
2020-10-11 02:48:35 +02:00
Marcel Otto 875908eb39 Handle conflicting terms for the same IRI in a PropertyMap 2020-10-11 02:35:58 +02:00
Marcel Otto 95a69d9007 Add Enumerable protocol implementation for RDF.PropertyMap 2020-10-11 01:07:53 +02:00
Marcel Otto a49229384e Extract map/2 function from values/2 on all RDF data structures
and add support for RDF.PropertyMaps on values/2 instead
2020-10-10 15:45:25 +02:00
Marcel Otto 5f16b9837c Fix RDF.Literal.new/1 test with custom datatypes 2020-10-09 16:39:59 +02:00
Marcel Otto d0e5b625fd Support for RDF.PropertyMaps as :context opt on functions with input data 2020-10-09 16:32:24 +02:00
Marcel Otto e681733652 Add RDF.PropertyMap 2020-10-08 22:49:45 +02:00
Marcel Otto 71292b721c Add :init option to RDF.Graph.new/2 and RDF.Dataset.new/2 2020-10-07 16:08:22 +02:00
Marcel Otto 9880fd7be3 Handle structs in the input of RDF data structure functions properly 2020-10-05 12:41:55 +02:00
Marcel Otto 08a97ff2dc Add support for quads in input data of RDF.Description functions 2020-10-05 01:28:24 +02:00
Marcel Otto 1a7ffe58c4 Change behaviour of put and add put_properties on RDF.Graph and Dataset 2020-10-04 16:31:41 +02:00
Marcel Otto 4408a04103 Adapt RDF.Dataset.put/3 to new forms of input 2020-10-04 13:25:24 +02:00
Marcel Otto 42f787836f Improve implementation of RDF.Graph.put/3
- fixes bugs with some combinations of possible inputs
- simplify implementation
- add opts
2020-10-04 03:07:27 +02:00
Marcel Otto 4dfc16a55a Improve tests of RDF.Description.put/3 2020-10-04 02:52:56 +02:00
Marcel Otto 9b1600c863 Fix bug in RDF.Graph.put/2 with quad input 2020-10-01 15:53:44 +02:00
Marcel Otto 7fda16a40e Change format for BGP queries to be inline with the common input formats 2020-10-01 15:50:52 +02:00
Marcel Otto 96bb678ffc Fix RDF.Graph.put/2 to ignore empty RDF.Descriptions 2020-09-30 10:47:02 +02:00
Marcel Otto f83ac494fc Rename RDF.Graph.delete_subjects/2 to RDF.Graph.delete_descriptions/2 2020-09-30 10:20:13 +02:00
Marcel Otto 6315b85edf Add RDF.Dataset.name/1 and RDF.Dataset.change_name/2 2020-09-28 20:48:10 +02:00
Marcel Otto 8b723286c5 Limit and unify the forms of input on RDF.Dataset functions 2020-09-28 17:39:31 +02:00
Marcel Otto 2a44765631 Add support for list of descriptions to RDF.Graph.put/2 2020-09-28 12:36:25 +02:00
Marcel Otto 69fbdd60b3 Add RDF.Graph.base_iri/1 and RDF.Graph.prefixes/1 2020-09-28 11:22:46 +02:00
Marcel Otto c306700991 Add RDF.Graph.name/1 and RDF.Graph.change_name/2 2020-09-28 11:09:35 +02:00
Marcel Otto a8c71df20b Limit and unify the forms of input on RDF.Graph functions 2020-09-28 02:49:41 +02:00
Marcel Otto 20a69964c7 Change RDF.Description.new/2 to take initial data via the :init option 2020-09-25 16:07:37 +02:00
Marcel Otto bcf024647e Merge branch 'master' into rdf-star 2020-09-24 12:05:41 +02:00
Marcel Otto a4b71b3f9d Add prefixed_name/2 and prefixed_name_to_iri/2 to RDF.PrefixMap 2020-09-16 00:38:56 +02:00
Marcel Otto bee5e3a81b Fix typo in RDF.PrefixMap test 2020-09-15 17:02:20 +02:00
Marcel Otto 081a78c692 Use prefixes of the graphs of a RDF.Dataset when serializing to Turtle 2020-09-14 16:41:41 +02:00
Marcel Otto 6e9889c1bd Add atoms for most common conflict resolvers on RDF.PrefixMap.merge/3 2020-09-14 15:50:32 +02:00
Marcel Otto 092db587b6 Add :only option to Turtle encoder for partial documents 2020-09-14 01:09:46 +02:00
Marcel Otto d9ab8b5804 Add :directive_style option to Turtle encoder 2020-09-13 22:16:12 +02:00
Marcel Otto 58c5772011 Add RDF.Description.subject/1 and RDF.Description.change_subject/2 2020-07-28 14:45:12 +02:00
Marcel Otto e9432ef556 Limit the forms of input on RDF.Description functions 2020-07-27 23:09:23 +02:00
Marcel Otto 909e2bde18 Rename the :id field of RDF.BlankNode to :value for consistency reasons 2020-07-08 22:02:58 +02:00
pukkamustard 2d68a352ed
Fix non-empty RDF.Graph when adding empty RDF.Description (#8) 2020-07-03 23:49:06 +02:00
Marcel Otto 0e81f4c02c Apply mix formatter 2020-06-29 10:37:42 +02:00
Marcel Otto 520a6ba58d Add API documentation for BGP querying and some fixes for the API 2020-06-16 12:05:44 +02:00
Marcel Otto 7d3473abd0 RDF graph query API 2020-06-13 16:16:52 +02:00
Marcel Otto 8d68e925ad Add path query builder 2020-06-12 02:53:29 +02:00
Marcel Otto b6aafccc7d Move query builder into own module 2020-06-12 00:19:31 +02:00
Marcel Otto 1aa2f22b92 Add RDF.Query.BGP builder 2020-06-10 01:13:01 +02:00
Marcel Otto f9e451f006 Change BGP matching query results to return variable keys as atoms 2020-06-08 21:56:50 +02:00
Marcel Otto 9cd4478574 Add RDF.Query.BGP struct 2020-06-08 11:36:22 +02:00
Marcel Otto 49bcb27bb0 Add streaming version of the BGP matching algorithm 2020-06-08 00:58:39 +02:00
Marcel Otto cbc525d982 Move BGP query planner and bnode handler to dedicated files 2020-06-07 23:30:34 +02:00
Marcel Otto ef218a3a90 Extract BGP query planner 2020-06-05 11:10:15 +02:00
Marcel Otto 1de3a7fa6f Add BGP matching algorithm behaviour with a simple implementation
This simple implementation was just extracted unchanged from SPARQL.ex
2020-06-04 21:39:13 +02:00
Marcel Otto 3743b0e406 Add RDF.Literal.is_a?/2 2020-05-27 23:55:43 +02:00
Marcel Otto 98adbaf878 Handle derived datatypes on RDF.Literal.Datatype.compare/2 properly 2020-05-27 00:56:44 +02:00
Marcel Otto 162e82ed47 Handle derived datatypes on RDF.Literal.Datatype.equal_value?/2 properly 2020-05-25 23:10:50 +02:00
Marcel Otto d247e1bf4f Support derived datatypes on RDF.Literal.Datatype.value/1 and valid?/2 2020-05-24 21:13:04 +02:00
Marcel Otto 7daf494fb9 Restore ability to cast RDF.IRIs to XSD.Strings and XSD.AnyURIs
This is needed for SPARQL.
2020-05-23 00:31:15 +02:00
Marcel Otto ffebf86505 Remove redundant tests 2020-05-22 10:21:29 +02:00
Marcel Otto 6c102c7ec8 Add explicitTimezone XSD datatype facet 2020-05-22 01:01:08 +02:00
Marcel Otto 486a64b4d7 Add totalDigits and fractionDigits XSD datatype facets 2020-05-21 22:57:03 +02:00
Marcel Otto c2a28b3eb4 Add pattern XSD datatype facet 2020-05-21 17:54:38 +02:00
Marcel Otto 80b1382fa9 Add length facets to XSD.AnyURI 2020-05-21 17:50:53 +02:00
Marcel Otto dbaac77dbb Handle derived types in RDF.Literal.Datatype.cast/1 implementations 2020-05-21 15:42:02 +02:00
Marcel Otto c1a61c58e8 Remove coercion on RDF.Literal.Datatype.cast/1
It's not worth the effort and more explicit to do the coercion step

manually.
2020-05-21 01:58:07 +02:00
Marcel Otto accf66d75f Fix failing of numeric operations with invalid literals 2020-05-20 00:32:20 +02:00
Marcel Otto fa130bf14e Fix type promotion on numeric operations with derived datatypes 2020-05-19 03:09:29 +02:00
Marcel Otto 22c2aaa1af Add length, minLength and maxLength XSD datatype facets 2020-05-17 22:54:07 +02:00
Marcel Otto 2c4b5f604a Add minExclusive and maxExclusive XSD datatype facets 2020-05-17 21:51:03 +02:00
Marcel Otto 09dceb0e35 Add proper handling for derived datatypes on numeric operations
with type promotion
2020-05-17 21:49:07 +02:00
Marcel Otto bf932be26d Add min- and max-inclusive facet implementations to decimal and double 2020-05-17 20:21:00 +02:00
Marcel Otto 5daf32446d Fix regression in RDF.LangString.match_language?/2 2020-05-17 02:47:48 +02:00
Marcel Otto 47a19c0a67 Add proper handling of vocabulary terms at various places
- in the coerce and value functions of the RDF.Term protocol for atoms
- allow them as XSD.AnyURI values
- RDF.Literal.coerce produces XSD.AnyURI literals from them
- allow them in equal_value comparisons with RDF.IRIs and XSD.AnyURIs
2020-05-17 00:53:36 +02:00
Marcel Otto 76b6f69613 Fix raised BEAM error warning when namespace resolving top-level modules 2020-05-17 00:01:18 +02:00
Marcel Otto 4d3d60a5f4 Fix regression in handling of vocabulary terms as generic datatypes 2020-05-16 14:42:12 +02:00
Marcel Otto 0509e4cb2f Store datatype in a RDF.Literal.Generic internally as string
Besides being a bit more memory efficient this allows for
pattern matching on the datatype of generic literals.
2020-05-16 00:06:45 +02:00
Marcel Otto 25a0f7443c Rename RDF.Literal.datatype/1 and similar functions to datatype_id/1 2020-05-15 22:59:05 +02:00
Marcel Otto fa35b65d9f Redesign datatype reflection API 2020-05-15 17:13:31 +02:00
Marcel Otto 042ff1c1b8 Drop support for Elixir versions < 1.8 2020-05-11 23:21:20 +02:00
Marcel Otto b53d09d4f5 Add RDF.Literal.Datatype.Registry.xsd_datatype/1 2020-05-10 01:37:01 +02:00
Marcel Otto d18c7ed475 Refactor datatype registry 2020-05-10 01:35:07 +02:00
Marcel Otto afc6f28cf4 Always resolve datatype IRIs through the registration protocol
It's actually faster (although just slightly) than the map access!
2020-05-09 00:54:35 +02:00
Marcel Otto c22bab6c74 Change Namespace.resolve_term to return ok tuples and add resolve_term! 2020-05-09 00:26:29 +02:00
Marcel Otto 2b46bb8f23 Restore casting of IRIs to strings 2020-05-07 21:18:05 +02:00
Marcel Otto d324b464b2 Add test for comparison betweens string and langString literals 2020-05-07 21:17:16 +02:00
Marcel Otto faaebb2de2 Add ProtocolEx-based custom datatype registration 2020-05-07 15:37:21 +02:00
Marcel Otto 4fedb2cfc0 Fix test of RDF.Literal.new/1 with plain datatype literals 2020-05-06 22:33:28 +02:00
Marcel Otto 24051c6153 Add RDF.Guards.maybe_ns_term/1 2020-05-06 18:04:19 +02:00
Marcel Otto 00a6103e56 Interop between RDF.IRI and XSD.AnyURI in terms of cast and equal_value? 2020-05-06 16:48:31 +02:00
Marcel Otto 6057749d2a Move XSD.Datatype.canonical_lexical/1 up to RDF.Literal.Datatype 2020-05-06 15:19:32 +02:00
Marcel Otto 6e557a8bee Remove some higher-level functions from the datatypes
Higher-level datatype functions should be implemented on RDF.Literal only
2020-05-06 15:17:43 +02:00
Marcel Otto 5819eec0cf Re-integrate XSD.ex
It turned out that the costs of separating the XSD datatypes are too high
and probably not worth the effort, since with its limited scope
probably nobody would want to use XSD.ex outside of the RDF.ex context
anyway.
2020-05-05 23:58:44 +02:00
Marcel Otto adb1c12634 Restore equality tests 2020-04-18 21:38:21 +02:00
Marcel Otto aed10650d8 Finish back to previous equal_value?/2 behaviour 2020-04-18 21:31:42 +02:00
Marcel Otto 733f01e6a9 Revert "Add comparable?/2 functions to RDF.Literal and RDF.Literal.Datatypes"
This reverts commit 287839740c.
2020-04-18 16:39:43 +02:00
Marcel Otto 287839740c Add comparable?/2 functions to RDF.Literal and RDF.Literal.Datatypes 2020-04-18 00:31:03 +02:00
Marcel Otto 9e3fbde380 Add missing validity check to cast/1 functions 2020-04-17 00:50:06 +02:00
Marcel Otto 44a3ecb57a Don't support cast/1 on RDF.Literal.Generic 2020-04-16 23:42:55 +02:00
Marcel Otto 060fac4675 Add update/2 functions to RDF.Literal and the datatypes 2020-04-16 20:57:10 +02:00
Marcel Otto 238c9310be Add some XSD datatype specific delegation functions 2020-04-16 20:55:30 +02:00
Marcel Otto 2be689b2a1 Various datatype fixes 2020-04-12 23:55:34 +02:00
Marcel Otto fa4bfdff1a Change constructor interface of RDF.LangString and RDF.Generic 2020-04-12 04:34:04 +02:00
Marcel Otto f6146c51b0 Revision of the literal system with extracted XSD datatypes 2020-04-10 23:56:35 +02:00
Marcel Otto c4791af2ad Get rid of remaining compiler warnings during test 2020-04-05 01:33:42 +02:00
Marcel Otto 319940b442 Ignore some compiler warnings during test 2020-04-05 00:53:54 +02:00
Marcel Otto a77fe7c56e Add RDF.Diff.empty?/1 2019-11-20 01:56:43 +01:00
Marcel Otto a1cbbd24b6 Add RDF.Diff.apply/2 2019-11-20 01:45:34 +01:00
Marcel Otto 4e38080774 Add RDF.Diff 2019-11-19 22:49:00 +01:00
Marcel Otto 30bde1acc2 Add RDF.Graph.clear/1 2019-11-02 01:35:09 +01:00
Marcel Otto 02131efc15 Add RDF.Graph.update/4 2019-10-24 22:03:05 +02:00
Marcel Otto 623577b35e Add RDF.Description.update/4 2019-10-23 17:31:21 +02:00
Marcel Otto 2cfa89125f Add RDF.Graph.take/3 2019-10-15 17:29:46 +02:00
Marcel Otto cf568dd06e Add RDF.Description.take/2 2019-10-14 09:13:56 +02:00
Marcel Otto 9e81f69636 Remove RDF.IRI.empty_fragment_shim/2
This is no longer needed, since we don't support Elixir versions < 1.6
anymore.
2019-09-24 00:50:34 +02:00
Marcel Otto 3f1afa190f Use new RDF.IRI.coerce_base/1 for RDF.Graph.set_base_iri/2 2019-08-08 22:32:21 +02:00
Marcel Otto fe49c0e431 Move base IRI coercion from PrefixMap into new RDF.IRI.coerce_base/1
- and extend it to also support terms from vocabulary namespaces
2019-08-08 22:26:07 +02:00
Marcel Otto 58d21a3405 Add alias base_iri for the base option of the RDF.Turtle.Encoder 2019-08-03 01:33:47 +02:00
Marcel Otto 14b1dc5825 Let RDF.Turtle.Encoder use base IRI from the graph when none provided 2019-08-03 01:02:32 +02:00
Marcel Otto 19e12909ca Change RDF.Turtle.Decoder to save the base IRI in the graph 2019-08-03 00:41:06 +02:00
Marcel Otto b28e5e4744 Add RDF.Graph.base_iri field and functions to handle it 2019-08-03 00:36:25 +02:00
Marcel Otto 1f07377cae Fix unicode escaping issue in RDF.Literal.matches 2019-07-06 01:59:03 +02:00
Marcel Otto 49a897d79b Fix UTF-16 character handling in regex patterns 2019-06-23 15:47:18 +02:00
Marcel Otto dc2b070e05 Fix RDF.Double to not accept +INF as a valid value 2019-06-23 15:45:23 +02:00
Marcel Otto 874b0d5eea Include test support files via elixirc_paths 2019-06-09 21:48:03 +02:00
Marcel Otto 34eaacdf37 true and false with capital letters are no longer valid RDF.Booleans 2019-06-08 22:56:22 +02:00
Marcel Otto 5b10ccd58b Fix RDF.Literal.new/1 to handle decimals correctly 2019-05-04 14:59:33 +02:00
Marcel Otto f89b34ed4b Add RDF.IRI.to_string/1 2019-05-01 03:06:35 +02:00
Marcel Otto 568190e327 Add digit_count and fraction_digit_count to RDF.Decimal 2019-04-22 11:17:16 +02:00
Marcel Otto 489e964c6d Add RDF.Literal.matches?/3 2019-04-20 23:33:09 +02:00
Marcel Otto 95d5d01217 Fix RDF.Dataset.equal?/2 to ignore prefixes 2019-04-04 21:19:33 +02:00
Marcel Otto 731b168ef4 Add RDF.Data.equal?/2 2019-04-04 01:55:34 +02:00
Marcel Otto 158decc16b Add equal?/2 on RDF.Description, RDF.Graph and RDF.Dataset 2019-04-03 00:15:25 +02:00
Marcel Otto 2e49f8b73a Let RDF.Turtle.Encoder use other prefixes when none provided 2019-04-02 00:34:19 +02:00
Marcel Otto eb71b26f08 Remove unnecessary whitespace 2019-04-01 02:04:51 +02:00
Marcel Otto 74490c96c9 Change RDF.Turtle.Decoder to save the prefixes in the graph 2019-03-31 05:07:34 +02:00
Marcel Otto 195b967b93 Add prefix management to RDF.Graph 2019-03-31 01:15:56 +01:00
Marcel Otto c2e6ffdebb Optimize RDF.PrefixMap.new/1 creation from another PrefixMap 2019-03-30 22:11:04 +01:00
Marcel Otto 6c9f580cab Add RDF.PrefixMap.drop/2 2019-03-30 20:29:48 +01:00
Marcel Otto ec33614880 Fix RDF.PrefixMap.merge/3 when the merged prefixes are not a PrefixMap 2019-03-30 20:12:39 +01:00
Marcel Otto 15961b8fef Fix detection of vocabulary namespaces 2019-03-30 02:01:30 +01:00