Skip to content

Commit

Permalink
Custom parser section added to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
wstrinz committed Oct 20, 2013
1 parent 6744614 commit f249dd2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,14 @@ generate_n3
The API doc is online. For more code examples see the test files in
the source tree.

### Custom Parsers

Building a parser simply requires you to implement a `generate_n3` method, either at the class or instance level. Then register it using `Publisci::Dataset.register_reader(extension, class)` using your reader's preferred file extension and its class. This way, if you call the `Dataset.for` method on a file with the given extension it will use your reader class.

Including or extending the `Publisci::Readers::Base` will give you access to many helpful methods for creating a triplifying your data. There is a post on the [project blog](http://gsocsemantic.wordpress.com/2013/08/31/parsing-with-publisci-how-to-get-your-data-into-the-semantic-web/) with further details about how to design and implement a parser.

The interface is in the process of being more rigdly defined to separate parsing, generation, and output, and it is encourage that you make your parsing code as stateless as possible to assist in handling large inputs. Pull requests with parsers for new formats are greatly appreciated however!

## Project home page

Information on the source tree, documentation, examples, issues and
Expand Down

0 comments on commit f249dd2

Please sign in to comment.