# Parsers in Raptor (syntax to triples)

## Introduction

This section describes the parsers that can be compiled into Raptor and their features. The exact parsers supported may vary by different builds of raptor and can be queried at run-time by use of the `raptor_parsers_enumerate` and `raptor_syntaxes_enumerate` functions

The optional features that may be set on parsers can also be queried at run-time iwth the `raptor_features_enumerate` function.

## GRDDL over XHTML/XML using XSLT parser (name `grddl`)

A parser for Gleaning Resource Descriptions from Dialects of Languages (GRDDL) which allows reading XHTML and XML as RDF triples by using profiles in the document that declare XSLT transforms from the XHTML/XML content into RDF/XML which is the RDF content.

The parser does not support all the GRDDL styles, for example `dataview:namespaceTransformation`, or perform recursive transformations.

## Guess parser (name `guess`)

This is a special parser that picks the actual parser to use based on the content type, the content bytes or the content identifier. The content name can be either from a local file or from a URI.

If the protocol that delivered the content (such as HTTP) provided a Content Type (aka MIME Type) then this will be the primary means for identifying th ecotnent.

The secondary means to identify the content are the bytes of the content (if available), otherwise the content identifier is used, which is the least reliable.

## N-Triples parser (name `ntriples`)

A parser for the N-Triples syntax as used by the W3C RDF Core working group for the RDF Test Cases.

## RDF/XML parser - default (name `rdfxml`)

A parser for the standard RDF/XML syntax as revised by the W3C RDF Core working group.

This is the default parser in Raptor.

Features of this parser:

- Fully handles the RDF/XML syntax updates for XML Base, `xml:lang`, RDF datatyping and Collections.

- Handles all RDF vocabularies such as FOAF, RSS 1.0, Dublin Core, OWL, DOAP

- Handles `rdf:resource` / `resource` attributes

- Uses expat and/or (GNOME) libxml XML parsers as available or required

## RSS Tag Soup parser (name `rss-tag-soup`)

A parser for the multiple XML RSS formats that use the elements such as `channel`, `item`, `title`, `description` in different ways. This includes support for the Atom 1.0 syndication format defined in IETF RFC 4287

The parser attempts to turn the input into RSS 1.0 RDF triples in the RSS 1.0 model of a syndication feed. This includes triples for RSS Enclosures.

True RSS 1.0 when wanted to be used as a full RDF vocabulary, is best parsed by the RDF/XML parser (name `rdfxml`).

## Turtle Terse RDF Triple Language parser (name `turtle`)

A parser for the Turtle Terse RDF Triple Language syntax, designed as a useful subset of Notation 3.