These serializers are available in default RDFLib, you can use them by passing the name to graph’s parse() method:
graph.parse(my_url, format='n3')
The html parser will auto-detect RDFa, HTurtle or Microdata.
It is also possible to pass a mime-type for the format parameter:
graph.parse(my_url, format='application/rdf+xml')
If you are not sure what format your file will be, you can use rdflib.util.guess_format() which will guess based on the file extension.
| Name | Class |
|---|---|
| html | StructuredDataParser |
| hturtle | HTurtleParser |
| mdata | MicrodataParser |
| microdata | MicrodataParser |
| n3 | N3Parser |
| nquads | NQuadsParser |
| nt | NTParser |
| rdfa | RDFaParser |
| rdfa1.0 | RDFa10Parser |
| rdfa1.1 | RDFaParser |
| trix | TriXParser |
| turtle | TurtleParser |
| xml | RDFXMLParser |