Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work-in-progress RDF/XML parser #9

Merged
merged 50 commits into from
Jun 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
7ec2f1a
Setup W3C tests for RDF/XML parser implementation
althonos May 19, 2019
3f8c2e2
Add early working version of RDF/XML parser
althonos May 20, 2019
135f280
Add `xml` namespace to `sophia::ns` module
althonos May 20, 2019
d53c422
Add support for `xml:lang` and literal properties in XML parser
althonos May 20, 2019
18237b6
Add Dublin Core elements namespace as `::ns::dc::elements`
althonos May 20, 2019
f38be3f
Improve literal management and add more W3C tests
althonos May 21, 2019
546d05e
Add support for `nodeID` in XML predicates elements
althonos May 21, 2019
8026c13
Add support for `parseType=Resource' in XML parser
althonos May 21, 2019
4f4ec3b
Remove unused `in_node` field from `XmlParser`
althonos May 21, 2019
dac36bc
Refactor XML parser with better scope management
althonos May 22, 2019
c8af31c
Remove unneeded `Debug` trait bound on `Term::new_literal_dt`
althonos May 22, 2019
f102b8f
Add support for property attributes on property elements
althonos May 22, 2019
8f9e560
Add support for `rdf:li` metaproperty syntax
althonos May 22, 2019
7300bd1
Remove `curie` and `pretty-assertions` from cargo dependencies
althonos May 22, 2019
056f93e
Add support for reified triples in RDF/XML documents
althonos May 22, 2019
d4da809
Add support for `parseType=Collection' in XML parser
althonos May 23, 2019
23f899a
Fix inconsistent state when exiting a collection in XML Parser
althonos May 23, 2019
f2c2f32
Add `rdf-containers-syntax-vs-schema` W3C tests to XML parser
althonos May 23, 2019
e6b146d
Fix bug with `rdf:li` in XML parser
althonos May 23, 2019
524dfc7
Improve RDF tests handling in `::parser::xml` module
althonos May 23, 2019
dbb6cec
Fix `predicate_end` not producing triple on missing top-level `RDF` e…
althonos May 23, 2019
b8de13c
Expand `rdf:type` as URIs instead of literal in XML parser
althonos May 23, 2019
642c527
Add method to `parser::xml::Config` to parse using a base URI
althonos May 23, 2019
22ebf80
Add more W3C RDF/XML tests for XML parser and fix reification behaviour
althonos May 23, 2019
3b84ceb
Fix reification of triples in XML parser
althonos May 24, 2019
e7fb7dc
Use `url` crate to handle `xml:base` IRI expansion in `::parser::xml`
althonos May 24, 2019
be0b530
Fix handling of attributes in reified XML predicates
althonos May 24, 2019
03da205
Fix more RDF/XML behaviour tests in `::parser::xml`
althonos May 24, 2019
f3846cd
Fix test predicate XML element declaring annotation of implicit bnode
althonos May 24, 2019
6aced01
Fix `::parser::xml::rdfms_para196::test001` using wrong resource file
althonos May 24, 2019
e649ff3
Transform empty Start/End events into a single Empty event in XML parser
althonos May 24, 2019
2c1c896
Use `AtomicUsize` instead of `AtomicU64` in `::parser::xml`
althonos May 24, 2019
b713979
Improve `XmlReader.read_event` to merge start/end events even when th…
althonos Jun 4, 2019
26371d0
Use `XmlReader.decode` to decode element names instead of assuming UTF-8
althonos Jun 4, 2019
6786a5c
Fix reader creating percent-encoding URIs in `::parser::xml`
althonos Jun 4, 2019
d68c28f
Add test harness for RDF/XML expected failures in `rdf-tests`
althonos Jun 4, 2019
0cf3c65
Add missing RDF syntax elements to `rdf` namespace in `::ns`
althonos Jun 7, 2019
669495b
Add error type and add RDF property name verification in XML parser
althonos Jun 7, 2019
cee5692
Add an XML name validator using a `pest` parser
althonos Jun 7, 2019
59d1dba
Add XML name validation for `ID` and `nodeID` attributes of node elem…
althonos Jun 7, 2019
8360b27
Make sure `ID` values are unique (after expansion) in a RDF/XML document
althonos Jun 7, 2019
0b0b0d2
Detect invalid use of `parseType=Literal` in XML document
althonos Jun 7, 2019
2ccd8b3
Fudge-fix inconsistent percent-encoding of IRI when parsing RDF/XML docs
althonos Jun 7, 2019
c7ec285
Refactor `::parser::xml` to allow reusing the same XML buffer
althonos Jun 7, 2019
6882ef9
Remove all panics from RDF/XML parser and use proper error chaining
althonos Jun 7, 2019
7680933
Remove `Debug` constraint on term data in `::parser::xml`
althonos Jun 7, 2019
f6eb5fe
Use conversion traits to reduce boilerplate in `::parser::xml`
althonos Jun 7, 2019
30c60d9
Remove `dc` from `::ns` module and fix `xml` and `rdf` namespaces
althonos Jun 11, 2019
debd9e8
Remove `xmlname.pest` and use regex instead
althonos Jun 11, 2019
abc5888
Rework error management to chain XML parser errors into `ParserError`
althonos Jun 13, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sophia/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ language-tag = "0.9.0"
lazy_static = "1.2.0"
pest = "2.1.0"
pest_derive = "2.1.0"
quick-xml = "0.14.0"
althonos marked this conversation as resolved.
Show resolved Hide resolved
regex = "1.1.0"
rental = "0.5.2"
resiter = "0.3.0"
Expand Down
1 change: 1 addition & 0 deletions sophia/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ extern crate pest_derive;
extern crate regex;
#[macro_use]
extern crate rental;
extern crate quick_xml;
extern crate resiter;
extern crate url;
extern crate weak_table;
Expand Down
29 changes: 28 additions & 1 deletion sophia/src/ns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ use crate::error::*;
use crate::term::{iri_rfc3987::is_valid_iri, Term, TermData};

/// A custom namespace.
#[derive(Clone, Debug)]
pub struct Namespace<T: TermData>(T);

impl<T: TermData> Namespace<T> {
Expand Down Expand Up @@ -102,7 +103,20 @@ pub mod rdf {
subject,
value,
// individuals
nil
nil,
// core syntax terms
RDF,
ID,
Description,
about,
parseType,
resource,
li,
nodeID,
datatype,
bagID,
aboutEach,
aboutEachPrefix
);
ns_term!("http://www.w3.org/1999/02/22-rdf-syntax-ns#", type_, "type");
}
Expand Down Expand Up @@ -186,6 +200,19 @@ pub mod rdfs {
);
}

/// The standard `xml:` namespace
pub mod xml {
namespace!(
"http://www.w3.org/XML/1998/namespace#",
lang,
space,
base,
id,
// Jon Bosak
Father
);
}

#[cfg(test)]
mod test {
// Nothing really worth testing here
Expand Down
1 change: 1 addition & 0 deletions sophia/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@
pub mod common;
pub mod nq;
pub mod nt;
pub mod xml;
Loading