llyn.py Content Sniffing Problem Patch

Hi,

When I process an N3 file with "log:semantics" in a rule, llyn.py will
incorrectly guess that the file that I want it to parse is an XML RDF
file, even if it's clearly Notation3. I managed to isolate the
problem, which was that it searched for the string "xmlns" in the
file, and I was using a namespace of DanBri's, with "xmlns.com" in the
URI :-)

To fix it I simply changed:-

[[[
            if buffer.find('xmlns') >=0:
]]]

to:-

[[[
            if buffer.find('rdf:RDF') >=0:

]]]

and it worked.

--
Kindest Regards,
Sean B. Palmer
@prefix : <http://webns.net/roughterms/> .
:Sean :hasHomepage <http://purl.org/net/sbp/> .

Received on Friday, 7 December 2001 12:14:35 UTC