recurse / rdfquery

Automatically exported from code.google.com/p/rdfquery
0 stars 0 forks source link

"href" attribute being used as the subject instead of "about" #22

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Visit http://alf.hubmed.org/rdfa/2010-03-01/
2. Compare the difference between the triples extracted from Test 1 (where
the artist has both "href" and "about" attributes) and Test 2 (where the
artist has only an "about" attribute).

What is the expected output? What do you see instead?
Expected:
The "about" attribute is used as the subject of the foaf:name triple.
<http://example.com/artist/1#artist> a
<http://purl.org/ontology/mo/MusicArtist>
<http://example.com/artist/1#artist> <http://xmlns.com/foaf/0.1/name>
"Artist 1"

Actual:
The "href" attribute is used as the subject of the foaf:name triple.
<http://example.com/artist/1#artist> a
<http://purl.org/ontology/mo/MusicArtist>
<http://example.com/artist/1> <http://xmlns.com/foaf/0.1/name> "Artist 1"

What version of the product are you using? On what operating system?
1.0 from Subversion, Firefox 3.6, Mac OS X.

Please provide any additional information below.

Original issue reported on code.google.com by eaton....@gmail.com on 1 Mar 2010 at 12:47

GoogleCodeExporter commented 9 years ago
This is fixed by the change below, but this also breaks a couple of the RDFa 
tests so
may not be the best solution.

--- jquery.rdfa.js  (revision 185)
+++ jquery.rdfa.js  (working copy)
@@ -238,7 +238,7 @@
         } else if (atts['typeof'] !== undefined) {
           subject = $.rdf.blank('[]');
         } else if (elem[0].parentNode.nodeType === 1) {
-          subject = context.object || getObjectResource(elem.parent()) ||
getSubject(elem.parent()).subject;
+          subject = context.object || getSubject(elem.parent()).subject ||
getObjectResource(elem.parent());
           skip = !r && atts.property === undefined;
         } else {
           subject = docResource;

Original comment by eaton....@gmail.com on 1 Mar 2010 at 5:22