/* -*- Mode: c; c-basic-offset: 2 -*-
 *
 * example.c - Redland example parsing RDF from a URI, storing on disk as BDB hashes and querying the results
 *
 * $Id: example1.c,v 1.19 2003/12/14 19:40:21 cmdjb Exp $
 *
 * Copyright (C) 2000-2001 David Beckett - http://purl.org/net/dajobe/
 * Institute for Learning and Research Technology - http://www.ilrt.org/
 * University of Bristol - http://www.bristol.ac.uk/
 * 
 * This package is Free Software or Open Source available under the
 * following licenses (these are alternatives):
 *   1. GNU Lesser General Public License (LGPL)
 *   2. GNU General Public License (GPL)
 *   3. Mozilla Public License (MPL)
 * 
 * See LICENSE.html or LICENSE.txt at the top of this package for the
 * full license terms.
 * 
 * 
 */


#include <stdio.h>
#include <string.h>
#include <stdarg.h>

#include <redland.h>


/* one prototype needed */
int main(int argc, char *argv[]);



int
main(int argc, char *argv[]) 
{
  librdf_world* world;
  librdf_storage* storage;
  librdf_parser* parser;
  librdf_model* model;
  librdf_stream* stream;
  librdf_node *subject, *predicate;
  librdf_iterator* iterator;
  librdf_statement *partial_statement, *statement2;
  char *program=argv[0];
  librdf_uri *uri;
  char *parser_name=NULL;
  int count;
  /* <!-- START --> */
  librdf_world_open(world=librdf_new_world());

  uri=librdf_new_uri(world, "http://planetrdf.com/index.rdf");
  storage=librdf_new_storage(world, "memory", NULL, NULL);
  model=librdf_new_model(world, storage, NULL);
  librdf_model_load(model, uri, "rdfxml", NULL, NULL);

  librdf_model_print(model, stdout);

  librdf_free_model(model);
  librdf_free_storage(storage);
  librdf_free_uri(uri);
  librdf_free_world(world);
  /* <!-- END --> */

  return(0);
}
