Skip Menu |

This queue is for tickets about the RDF-Simple CPAN distribution.

Report information
The Basics
Id: 43688
Status: resolved
Priority: 0/
Queue: RDF-Simple

People
Owner: MTHURN [...] cpan.org
Requestors: m-grady [...] illinois.edu
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: RDF::Simple::Parser and empty element
Date: Thu, 26 Feb 2009 22:33:56 -0600
To: bug-RDF-Simple [...] rt.cpan.org
From: "Michael A. Grady" <m-grady [...] illinois.edu>
I'm parsing an RDF-XMl file that has, as an example: <?xml version="1.0" encoding="UTF-8"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:a="tag:tupeloproject.org,2006:/2.0/files/" xmlns:b="http:// nees.ncsa.uiuc.edu/2009/ns#" xmlns:cet="http://cet.ncsa.uiuc.edu/ 2007/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdfs="http:// www.w3.org/2000/01/rdf-schema#"> <cet:Dataset rdf:about="http://nees.ncsa.uiuc.edu/2009/ns/ file#113347"> <dc:date rdf:datatype="http://www.w3.org/2001/ XMLSchema#dateTime">2006-11-08T06:00:00.000Z</dc:date> <dc:description/> <rdf:type rdf:resource="tag:tupeloproject.org,2006:/2.0/files/ File"/> <rdfs:label>POLICY.pdf</rdfs:label> </cet:Dataset> </rdf:RDF with code (after having done my @triples = $parser->parse_rdf($rdf);) foreach (@triples) { $triple = $_; $value1 = $triple->[0]; $value2 = $triple->[1]; defined($value3 = $triple->[2]) || ($value3 = ''); print "value1: $value1\n\tvalue2: $value2\n\tvalue3: $value3\n\n"; } producing: value1: http://nees.ncsa.uiuc.edu/2009/ns/file#113347 value2: http://purl.org/dc/elements/1.1/date value3: 2006-11-08T06:00:00.000Z value1: http://nees.ncsa.uiuc.edu/2009/ns/file#113347 value2: http://purl.org/dc/elements/1.1/description value3: _:id49a766aa045f value1: http://nees.ncsa.uiuc.edu/2009/ns/file#113347 value2: http://www.w3.org/1999/02/22-rdf-syntax-ns#type value3: file:///Users/admin/Desktop/nees- rdf.xmltag:tupeloproject.org,2006:/2.0/files/File value1: http://nees.ncsa.uiuc.edu/2009/ns/file#113347 value2: http://www.w3.org/2000/01/rdf-schema#label value3: POLICY.pdf Note the value for the "http://purl.org/dc/elements/1.1/description" of "_:id49a766aa045f" It doesn't appear that empty elements are being handled correctly. -- Michael A. Grady Executive Program Officer for Cyberinfrastructure Office of the CIO, University of Illinois at Urbana-Champaign 2222 DCL, MC 256, 1304 W. Springfield Ave., Urbana, IL 61801 217.244.1253 phone, 217.244.4780 fax
Subject: Re: [rt.cpan.org #43688] AutoReply: RDF::Simple::Parser and empty element
Date: Thu, 26 Feb 2009 22:57:41 -0600
To: bug-RDF-Simple [...] rt.cpan.org
From: "Michael A. Grady" <m-grady [...] illinois.edu>
Another odd bug I noticed is that a 'description' element near the end of the RDF-XML file had the beginning of its value 'truncated'. That is, the RDF-XML was: <dc:description>These experiments are part of a collaborative research project to study soil-foundation-structure interaction. A continuous reinforced concrete bridge supported on drilled shaft foundations was selected as the prototype structure for investigation. Two, 1/4-scale, reinforced concrete bents were constructed at a test site in southeast Austin. The primary difference between the two specimens was the clear height of the columns. Bent 1 had two, 12-in. diameter columns with a clear height of 6 ft. The clear height of the columns in Bent 2 was 3 ft. All four shafts had an embedded depth of 12 ft. The soil at the site was classified as nonplastic silt and the entire lengths of the shafts were above the water table.The two bents were tested dynamically during June and July 2005. Three types of dynamic tests were conducted. A modal hammer was used to excite the specimens using low- amplitude impulsive loads. T-Rex, a triaxial mobile shaker, was used to shake the ground near the bents and the linear shaker from Thumper was attached to the specimens at midspan of the beams.Static, pull- over tests are planned following the completion of the dynamic tests.</dc:description> But what I got from the parser for that was: value1: http://nees.ncsa.uiuc.edu/2009/ns/proj#88 value2: http://purl.org/dc/elements/1.1/description value3: ft. The clear height of the columns in Bent 2 was 3 ft. All four shafts had an embedded depth of 12 ft. The soil at t he site was classified as nonplastic silt and the entire lengths of the shafts were above the water table.The two bents were tested dynamically during June and July 2005. Three types of dynamic tests were conducted. A modal hammer was used to excite the specimens using low-amplitude impulsive loads. T-Rex, a triaxial mobile shaker, was used to shake the ground near the bents and the linear shaker from Thumper was attached to the specimens at midspan of the beams.Static, pull-over tests are planned following the completion of the dynamic tests. On Feb 26, 2009, at 10:34 PM, Bugs in RDF-Simple via RT wrote: Show quoted text
> > Greetings, > > This message has been automatically generated in response to the > creation of a trouble ticket regarding: > "RDF::Simple::Parser and empty element", > a summary of which appears below. > > There is no need to reply to this message right now. Your ticket > has been > assigned an ID of [rt.cpan.org #43688]. Your ticket is accessible > on the web at: > > http://rt.cpan.org/Ticket/Display.html?id=43688 > > Please include the string: > > [rt.cpan.org #43688] > > in the subject line of all future correspondence about this issue. > To do so, > you may reply to this message. > > Thank you, > bug-RDF-Simple@rt.cpan.org > > ---------------------------------------------------------------------- > --- > I'm parsing an RDF-XMl file that has, as an example: > > <?xml version="1.0" encoding="UTF-8"?> > <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" > xmlns:a="tag:tupeloproject.org,2006:/2.0/files/" xmlns:b="http:// > nees.ncsa.uiuc.edu/2009/ns#" xmlns:cet="http://cet.ncsa.uiuc.edu/ > 2007/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdfs="http:// > www.w3.org/2000/01/rdf-schema#"> > <cet:Dataset rdf:about="http://nees.ncsa.uiuc.edu/2009/ns/ > file#113347"> > <dc:date rdf:datatype="http://www.w3.org/2001/ > XMLSchema#dateTime">2006-11-08T06:00:00.000Z</dc:date> > <dc:description/> > <rdf:type rdf:resource="tag:tupeloproject.org,2006:/2.0/files/ > File"/> > <rdfs:label>POLICY.pdf</rdfs:label> > </cet:Dataset> > </rdf:RDF > > > with code (after having done my @triples = $parser->parse_rdf($rdf);) > > foreach (@triples) { > $triple = $_; > $value1 = $triple->[0]; > $value2 = $triple->[1]; > defined($value3 = $triple->[2]) || ($value3 = ''); > print "value1: $value1\n\tvalue2: $value2\n\tvalue3: $value3\n\n"; > } > > > producing: > > value1: http://nees.ncsa.uiuc.edu/2009/ns/file#113347 > value2: http://purl.org/dc/elements/1.1/date > value3: 2006-11-08T06:00:00.000Z > > value1: http://nees.ncsa.uiuc.edu/2009/ns/file#113347 > value2: http://purl.org/dc/elements/1.1/description > value3: _:id49a766aa045f > > value1: http://nees.ncsa.uiuc.edu/2009/ns/file#113347 > value2: http://www.w3.org/1999/02/22-rdf-syntax-ns#type > value3: file:///Users/admin/Desktop/nees- > rdf.xmltag:tupeloproject.org,2006:/2.0/files/File > > value1: http://nees.ncsa.uiuc.edu/2009/ns/file#113347 > value2: http://www.w3.org/2000/01/rdf-schema#label > value3: POLICY.pdf > > > Note the value for the "http://purl.org/dc/elements/1.1/description" > of "_:id49a766aa045f" > It doesn't appear that empty elements are being handled correctly. > > > -- > Michael A. Grady > Executive Program Officer for Cyberinfrastructure > Office of the CIO, University of Illinois at Urbana-Champaign > 2222 DCL, MC 256, 1304 W. Springfield Ave., Urbana, IL 61801 > 217.244.1253 phone, 217.244.4780 fax >
-- Michael A. Grady Executive Program Officer for Cyberinfrastructure Office of the CIO, University of Illinois at Urbana-Champaign 2222 DCL, MC 256, 1304 W. Springfield Ave., Urbana, IL 61801 217.244.1253 phone, 217.244.4780 fax
Do you know what the triple SHOULD look like for that empty element? Show quoted text
Subject: Re: [rt.cpan.org #43688] RDF::Simple::Parser and empty element
Date: Sat, 28 Feb 2009 21:38:18 -0600
To: bug-RDF-Simple [...] rt.cpan.org
From: "Michael A. Grady" <m-grady [...] illinois.edu>
Maybe I'm missing something about the question -- the value of the "description element" is '' (empty string or null), so the "value3" (the third element of the triple) should correspondingly be '' (an empty string), NOT '_:id49a766aa045f'. Are you saying that the RDF-XML sample I sent implies something different than my interpretation? I'm certainly not an RDF expert; I've just begun working with it. On Feb 28, 2009, at 9:22 PM, Martin Thurn via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=43688 > > > Do you know what the triple SHOULD look like for that empty element? >
-- Michael A. Grady Executive Program Officer for Cyberinfrastructure Office of the CIO, University of Illinois at Urbana-Champaign 2222 DCL, MC 256, 1304 W. Springfield Ave., Urbana, IL 61801 217.244.1253 phone, 217.244.4780 fax
Subject: RE: [rt.cpan.org #43688] RDF::Simple::Parser and empty element
Date: Sat, 28 Feb 2009 23:47:52 -0500
To: <bug-RDF-Simple [...] rt.cpan.org>, "'undisclosed-recipients:'"
From: "Martin Thurn" <mthurn [...] verizon.net>
Sorry, I'm not an RDF expert either... (I inherited this module and made a few simple bug fixes) When I asked the question, I was caught up / confused about the representation and the underlying value. I think you're right. I figured out how to get empty string into the triple, I'll also look into the truncated string issue and then make a new distro. - - Martin
Subject: Re: [rt.cpan.org #43688] RDF::Simple::Parser and empty element
Date: Sun, 1 Mar 2009 11:27:43 -0600
To: bug-RDF-Simple [...] rt.cpan.org
From: "Michael A. Grady" <m-grady [...] illinois.edu>
Thanks for such quick turnaround on this -- I'm impressed. On the truncated string issue, I did go into the Xml file just to see if there could have happened to be some sort of 'hidden" character (some non-printing extended ascii encoding) within that particular 'description' field, that could have conceivably caused a problem, and I didn't see anything. So it's still a complete mystery to me, particularly since the 'description' field immediately preceding this one is just as long (as I'd wondered if there could have been any "maximum character limit" or some such). On Feb 28, 2009, at 10:48 PM, mthurn@verizon.net via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=43688 > > > Sorry, I'm not an RDF expert either... (I inherited this module > and made a few simple bug fixes) When I asked the question, I was > caught up / confused about the representation and the underlying > value. I think you're right. > I figured out how to get empty string into the triple, I'll also > look into the truncated string issue and then make a new distro. > > - - Martin > >
-- Michael A. Grady Executive Program Officer for Cyberinfrastructure Office of the CIO, University of Illinois at Urbana-Champaign 2222 DCL, MC 256, 1304 W. Springfield Ave., Urbana, IL 61801 217.244.1253 phone, 217.244.4780 fax
Fixed both issues and uploaded 0.405 to CPAN just now.
Subject: Re: [rt.cpan.org #43688] RDF::Simple::Parser and empty element
Date: Mon, 2 Mar 2009 10:30:37 -0600
To: bug-RDF-Simple [...] rt.cpan.org
From: "Michael A. Grady" <m-grady [...] illinois.edu>
Great, thanks very much, and I'll try it out as soon as I can (hopefully later today). I don't "see" 0.405 at CPAN yet, but maybe there is some delay between you putting it up there and it getting made visible at http://search.cpan.org. I'll keep checking. On Mar 2, 2009, at 9:50 AM, Martin Thurn via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=43688 > > > Fixed both issues and uploaded 0.405 to CPAN just now.
-- Michael A. Grady Executive Program Officer for Cyberinfrastructure Office of the CIO, University of Illinois at Urbana-Champaign 2222 DCL, MC 256, 1304 W. Springfield Ave., Urbana, IL 61801 217.244.1253 phone, 217.244.4780 fax
Subject: Re: [rt.cpan.org #43688] RDF::Simple::Parser and empty element
Date: Wed, 4 Mar 2009 09:31:17 -0600
To: bug-RDF-Simple [...] rt.cpan.org
From: "Michael A. Grady" <m-grady [...] illinois.edu>
I kept checking, and your updated module finally showed up on the CPAN mirror my configs check. And the changes you made indeed fix the problems I was having, and in fact cleared up some other problems that I didn't realize I was having. So, as far as I can tell at this point, the RDF::Simple code is handling at least this sample of RDF- XML quite appropriately. Thanks again! On Mar 2, 2009, at 10:30 AM, Michael A. Grady wrote: Show quoted text
> Great, thanks very much, and I'll try it out as soon as I can > (hopefully later today). I don't "see" 0.405 at CPAN yet, but maybe > there is some delay between you putting it up there and it getting > made visible at http://search.cpan.org. I'll keep checking. > > > On Mar 2, 2009, at 9:50 AM, Martin Thurn via RT wrote: >
>> <URL: https://rt.cpan.org/Ticket/Display.html?id=43688 > >> >> Fixed both issues and uploaded 0.405 to CPAN just now.
> > > -- > Michael A. Grady > Executive Program Officer for Cyberinfrastructure > Office of the CIO, University of Illinois at Urbana-Champaign > 2222 DCL, MC 256, 1304 W. Springfield Ave., Urbana, IL 61801 > 217.244.1253 phone, 217.244.4780 fax
-- Michael A. Grady Executive Program Officer for Cyberinfrastructure Office of the CIO, University of Illinois at Urbana-Champaign 2222 DCL, MC 256, 1304 W. Springfield Ave., Urbana, IL 61801 217.244.1253 phone, 217.244.4780 fax
no message, just closing out this ticket