cygri / prefix.cc

Source code to the prefix.cc website
http://prefix.cc/
The Unlicense
38 stars 10 forks source link

Don't allow multiple #'s in URLs #36

Open andrefs opened 2 years ago

andrefs commented 2 years ago

https://prefix.cc/latitude currently maps to two possible URLs. One of them is:

https://www.w3.org/2006/vcard/ns#latitude#

This is mal-formed, as URLs cannot contain multiple hash signs.

I noticed when trying to parse https://prefix.cc/popular/all.file.ttl with rio's TurtleParser and got

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: 
TurtleError { 
    kind: InvalidIri { 
        iri: "https://www.w3.org/2006/vcard/ns#latitude#", 
        error: IriParseError { kind: InvalidIriCodePoint('#') } 
    }, 
    position: Some(LineBytePosition { line_number: 1286, byte_number: 65 }) 
}', src/prefixes/prefixcc.rs:31:10