[redland-dev] Mystery Parser Failure

Dave Beckett dave.beckett at bristol.ac.uk
Tue May 31 15:05:11 BST 2005


On Tue, 24 May 2005 15:49:40 +0100, Kieron Taylor <krt1 at soton.ac.uk> wrote:

> If I make the change suggested above, the error changes to:
> 
> rdf_parser.c:349: (librdf_parser_parse_into_model) assertion failed: 
> object pointer of type librdf_uri is NULL.
> 
> The curious thing about the first error is that 
> "/home/dump/triplestore/rdf/c/b/0" does not describe the complete string 
> from the file. It should also have a filename on the end and not be 
> sliced up.
> 
> I have included one of the rdf files upon which the parser barfs. I'm 
> using the Redland 1.0.0.2 bundle from Debian package lists.
> 
> Any more ideas?

I cannot duplicate it.  I made a simple program k.pl (attached) that
reads your data file, called k.rdf and it works just fine.  Using
either the redland 1.0.0 debs or redland 1.0.1 rpms.

$ perl k.pl
$ rdfproc test print
[[
  {(r1117548171r1), [http://purl.org/dc/elements/1.1/creator], "P.A.Temussi"}
  {(r1117548171r1), [http://purl.org/dc/elements/1.1/creator], "T.Tancredi"}
  {(r1117548171r1), [http://purl.org/dc/elements/1.1/creator], "F.Lelj"}
  {(r1117548171r1), [http://purl.org/dc/elements/1.1/creator], "M.R.Ciajolo"}
  {(r1117548171r1), [http://www.w3.org/2000/01/rdf-schema#value], "Acta - pp 1130 - vol 37 - 1981"}
  {(r1117548171r2), [http://purl.org/dc/terms/created], "2005-05-20T13:15:21Z"}
  {(r1117548171r2), [http://purl.org/dc/elements/1.1/creator], "Kieron Taylor"}
  {(r1117548171r2), [http://www.w3.org/2000/01/rdf-schema#type], [file:kchemschema.rdfs#Good]}
  {(r1117548171r3), [http://www.w3.org/2000/01/rdf-schema#_1], (r1117548171r5)}
  {(r1117548171r3), [http://www.w3.org/2000/01/rdf-schema#type], [file:kchemschema.rdfs#Laboratory]}
  {(r1117548171r3), [http://www.w3.org/2000/01/rdf-schema#type], [http://www.w3.org/2000/01/rdf-schema#Seq]}
  {(r1117548171r4), [http://green.chem.soton.ac.uk/rdf/chemschema.rdfs#has-description], "See file content and citation for experimental details"}
  {(r1117548171r5), [http://green.chem.soton.ac.uk/rdf/chemschema.rdfs#has-description], "See file content and citation for experimental details"}
  {(r1117548171r6), [http://purl.org/dc/elements/1.1/creator], "P.A.Temussi"}
  {(r1117548171r6), [http://purl.org/dc/elements/1.1/creator], "T.Tancredi"}
  {(r1117548171r6), [http://purl.org/dc/elements/1.1/creator], "F.Lelj"}
  {(r1117548171r6), [http://purl.org/dc/elements/1.1/creator], "M.R.Ciajolo"}
  {(r1117548171r6), [http://www.w3.org/2000/01/rdf-schema#value], "Acta - pp 1130 - vol 37 - 1981"}
  {(r1117548171r7), [http://green.chem.soton.ac.uk/rdf/units.rdfs#has-unit], (r1117548171r9)}
  {(r1117548171r7), [http://green.chem.soton.ac.uk/rdf/chemschema.rdfs#has-value], "397"}
  {(r1117548171r8), [http://purl.org/dc/terms/created], "2005-05-20T13:15:21Z"}
  {(r1117548171r8), [http://purl.org/dc/elements/1.1/creator], "Kieron Taylor"}
  {(r1117548171r8), [http://www.w3.org/2000/01/rdf-schema#type], [file:kchemschema.rdfs#Good]}
  {(r1117548171r9), [http://green.chem.soton.ac.uk/rdf/units.rdfs#has-unit], [file:kunits.rdfs#Celsius]}
  {(r1117548171r9), [http://green.chem.soton.ac.uk/rdf/units.rdfs#power-of], "1"}
  {(r1117548171r10), [http://www.w3.org/2000/01/rdf-schema#_1], (r1117548171r4)}  {(r1117548171r10), [http://www.w3.org/2000/01/rdf-schema#type], [file:kchemschema.rdfs#Laboratory]}
  {(r1117548171r10), [http://www.w3.org/2000/01/rdf-schema#type], [http://www.w3.org/2000/01/rdf-schema#Seq]}
  {[uri://green.chem.soton.ac.uk/file/500342], [http://purl.org/dc/terms/created], "2005-05-20T13:15:21Z"}
  {[uri://green.chem.soton.ac.uk/file/500342], [http://purl.org/dc/elements/1.1/type], [file:kchemschema.rdfs#Cif]}
  {[uri://green.chem.soton.ac.uk/file/500342], [http://green.chem.soton.ac.uk/rdf/chemschema.rdfs#filename], [file:/home/dump/triplestore/ciffiles/a/6/8/a68d862c50eb96e2a677c8f7d4dadf08.cif]}
  {[uri://green.chem.soton.ac.uk/property/500377], [http://purl.org/dc/terms/created], "2005-05-20T13:15:21Z"}
  {[uri://green.chem.soton.ac.uk/property/500377], [http://purl.org/dc/terms/provenance], (r1117548171r10)}
  {[uri://green.chem.soton.ac.uk/property/500377], [http://www.w3.org/2000/01/rdf-schema#type], [file:kchemschema.rdfs#Structure]}
  {[uri://green.chem.soton.ac.uk/property/500377], [http://purl.org/dc/terms/bibliographicCitation], (r1117548171r6)}
  {[uri://green.chem.soton.ac.uk/property/500377], [http://green.chem.soton.ac.uk/rdf/chemschema.rdfs#has-file], [uri://green.chem.soton.ac.uk/file/500342]}
  {[uri://green.chem.soton.ac.uk/property/500377], [http://green.chem.soton.ac.uk/rdf/chemschema.rdfs#has-source], [file:ksources.rdfs#CCDC]}
  {[uri://green.chem.soton.ac.uk/property/500377], [http://green.chem.soton.ac.uk/rdf/chemschema.rdfs#of-quality], (r1117548171r2)}
  {[uri://green.chem.soton.ac.uk/property/500378], [http://purl.org/dc/terms/created], "2005-05-20T13:15:21Z"}
  {[uri://green.chem.soton.ac.uk/property/500378], [http://purl.org/dc/terms/provenance], (r1117548171r3)}
  {[uri://green.chem.soton.ac.uk/property/500378], [http://www.w3.org/2000/01/rdf-schema#type], [file:kchemschema.rdfs#MeltingPoint]}
  {[uri://green.chem.soton.ac.uk/property/500378], [http://purl.org/dc/terms/bibliographicCitation], (r1117548171r1)}
  {[uri://green.chem.soton.ac.uk/property/500378], [http://green.chem.soton.ac.uk/rdf/chemschema.rdfs#has-source], [file:ksources.rdfs#CCDC]}
  {[uri://green.chem.soton.ac.uk/property/500378], [http://green.chem.soton.ac.uk/rdf/chemschema.rdfs#of-quality], (r1117548171r8)}
  {[uri://green.chem.soton.ac.uk/property/500378], [http://green.chem.soton.ac.uk/rdf/chemschema.rdfs#has-quantity], (r1117548171r7)}
  {[file:/home/dump/triplestore/rdf/a/6/8/a68d862c50eb96e2a677c8f7d4dadf08.rdf], [http://www.w3.org/2000/01/rdf-schema#type], [file:kchemschema.rdfs#OrganicMolecule]}
  {[file:/home/dump/triplestore/rdf/a/6/8/a68d862c50eb96e2a677c8f7d4dadf08.rdf], [http://green.chem.soton.ac.uk/rdf/chemschema.rdfs#has-rmm], "151.1626"}
  {[file:/home/dump/triplestore/rdf/a/6/8/a68d862c50eb96e2a677c8f7d4dadf08.rdf], [http://green.chem.soton.ac.uk/rdf/chemschema.rdfs#has-inchi], "C8H9NO2/c1-11-8-4-2-7(3-5-8)6-9-10/h2*2-6,10H,1H3/b2*9-6-"}
  {[file:/home/dump/triplestore/rdf/a/6/8/a68d862c50eb96e2a677c8f7d4dadf08.rdf], [http://green.chem.soton.ac.uk/rdf/chemschema.rdfs#has-ccdc-ref], "AANHOX"}
  {[file:/home/dump/triplestore/rdf/a/6/8/a68d862c50eb96e2a677c8f7d4dadf08.rdf], [http://green.chem.soton.ac.uk/rdf/chemschema.rdfs#has-property], [uri://green.chem.soton.ac.uk/property/500378]}
  {[file:/home/dump/triplestore/rdf/a/6/8/a68d862c50eb96e2a677c8f7d4dadf08.rdf], [http://green.chem.soton.ac.uk/rdf/chemschema.rdfs#has-property], [uri://green.chem.soton.ac.uk/property/500377]}
  {[file:/home/dump/triplestore/rdf/a/6/8/a68d862c50eb96e2a677c8f7d4dadf08.rdf], [http://green.chem.soton.ac.uk/rdf/chemschema.rdfs#has-simple-inchi], "C8H9NO2/c1-11-8-4-2-7(3-5-8)6-9-10/h2*2-6,10H,1H3"}
  {[file:/home/dump/triplestore/rdf/a/6/8/a68d862c50eb96e2a677c8f7d4dadf08.rdf], [http://green.chem.soton.ac.uk/rdf/chemschema.rdfs#has-stereocentres], "0"}
  {[file:/home/dump/triplestore/rdf/a/6/8/a68d862c50eb96e2a677c8f7d4dadf08.rdf], [http://green.chem.soton.ac.uk/rdf/chemschema.rdfs#has-empirical-formula], "C8H9NO2"}
]]
$

Dave
-------------- next part --------------
#!/usr/bin/perl

use RDF::Redland;

my $storage=new RDF::Redland::Storage("hashes", "test",
                                      "new='yes',hash-type='bdb',dir='.'");
die "Failed to create RDF::Redland::Storage\n" unless $storage;

my $model=new RDF::Redland::Model($storage, "");
die "Failed to create RDF::Redland::Model for storage\n" unless $model;

my $file="k.rdf";
$uri=new RDF::Redland::URI("file:$file");
die "Failed to create RDF::Redland::URI for file\n" unless $uri;

my $parser=new RDF::Redland::Parser("rdfxml", "application/rdf+xml");
die "Failed to create RDF::Redland:Parser\n" if !$parser;

$parser->parse_into_model($uri, $uri, $model);


More information about the redland-dev mailing list