Note that there are some explanatory texts on larger screens.

plurals
  1. POOpenCalais Parse RDF in .NET
    text
    copied!<p>is there a way to parse OpenCalais RDF in .NET as i'm using dotnetRDF and it keeps giving me errors. A sample of the Rdf generated may be found in <a href="http://viewer.opencalais.com/" rel="nofollow noreferrer">http://viewer.opencalais.com/</a> , i'm honestly really lost and would really appreciate any help! please help if you use any other apis or know how to make it work with dotnetRDF as i'm honestly really really lost</p> <p>Erika</p> <pre><code>&lt;!--Use of the Calais Web Service is governed by the Terms of Service located at http://www.opencalais.com. By using this service or the results of the service you agree to these terms of service.--&gt;&lt;!--Relations: PersonEmailAddress EmailAddress: jack@ctu.net, r.good@testings.com Person: Jack Bauer, Rose Goodings--&gt;&lt;rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:c="http://s.opencalais.com/1/pred/"&gt;&lt;rdf:Description c:allowDistribution="true" c:allowSearch="true" c:calaisRequestID="5e2f7759-55cb-ac2f-1281-b19ee8118cd9" c:externalID="calaisbridge" c:id="http://id.opencalais.com/KQGwCnWZBLPTHadX7uDMfA" rdf:about="http://d.opencalais.com/dochash-1/e7b46664-fa0c-3da1-88f9-cb79fe0d6902"&gt;&lt;rdf:type rdf:resource="http://s.opencalais.com/1/type/sys/DocInfo"/&gt;&lt;c:document&gt;&lt;![CDATA[Jack Bauer &lt;jack@ctu.net&gt; Rose Goodings &lt;r.good@testings.com&gt;]]&gt;&lt;/c:document&gt;&lt;c:docTitle/&gt;&lt;c:docDate&gt;2010-04-20 07:03:23.998&lt;/c:docDate&gt;&lt;c:externalMetadata c:caller="calaisbridge"/&gt;&lt;c:submitter&gt;calaisbridge&lt;/c:submitter&gt;&lt;/rdf:Description&gt;&lt;rdf:Description c:contentType="text/raw" c:emVer="7.1.1103.5" c:langIdVer="DefaultLangId" c:language="InputTextTooShort" c:processingVer="CalaisJob01" c:submissionDate="2010-04-20 07:03:23.905" rdf:about="http://d.opencalais.com/dochash-1/e7b46664-fa0c-3da1-88f9-cb79fe0d6902/meta"&gt;&lt;rdf:type rdf:resource="http://s.opencalais.com/1/type/sys/DocInfoMeta"/&gt;&lt;c:docId rdf:resource="http://d.opencalais.com/dochash-1/e7b46664-fa0c-3da1-88f9-cb79fe0d6902"/&gt;&lt;c:submitterCode&gt;416dcd8a-766f-0aa3-d94c-e5034b6ffc98&lt;/c:submitterCode&gt;&lt;c:signature&gt;digestalg-1|Kjq/y7thehi10hbBQ5v42YxE8n0=|a2DMjGG4mKEGTlIvvCvOg+BG1sCDrMZFSfRBjOBXMHwGtfLknC1nAQ==&lt;/c:signature&gt;&lt;/rdf:Description&gt;&lt;rdf:Description rdf:about="http://d.opencalais.com/dochash-1/e7b46664-fa0c-3da1-88f9-cb79fe0d6902/lid/DefaultLangId"&gt;&lt;rdf:type rdf:resource="http://s.opencalais.com/1/type/lid/DefaultLangId"/&gt;&lt;c:docId rdf:resource="http://d.opencalais.com/dochash-1/e7b46664-fa0c-3da1-88f9-cb79fe0d6902"/&gt;&lt;c:lang rdf:resource="http://d.opencalais.com/lid/DefaultLangId/InputTextTooShort"/&gt;&lt;/rdf:Description&gt;&lt;rdf:Description rdf:about="http://d.opencalais.com/pershash-1/a3100b92-7d3d-3f63-afcb-265678c15dcc"&gt;&lt;rdf:type rdf:resource="http://s.opencalais.com/1/type/em/e/Person"/&gt;&lt;c:name&gt;Jack Bauer&lt;/c:name&gt;&lt;c:persontype&gt;N/A&lt;/c:persontype&gt;&lt;c:nationality&gt;N/A&lt;/c:nationality&gt;&lt;c:commonname&gt;Jack Bauer&lt;/c:commonname&gt;&lt;/rdf:Description&gt;&lt;rdf:Description rdf:about="http://d.opencalais.com/dochash-1/e7b46664-fa0c-3da1-88f9-cb79fe0d6902/Instance/1"&gt;&lt;rdf:type rdf:resource="http://s.opencalais.com/1/type/sys/InstanceInfo"/&gt;&lt;c:docId rdf:resource="http://d.opencalais.com/dochash-1/e7b46664-fa0c-3da1-88f9-cb79fe0d6902"/&gt;&lt;c:subject rdf:resource="http://d.opencalais.com/pershash-1/a3100b92-7d3d-3f63-afcb-265678c15dcc"/&gt;&lt;!--Person: Jack Bauer; --&gt;&lt;c:detection&gt;[]Jack Bauer[ &amp;lt;jack@ctu.net&amp;gt; Rose Goodings]&lt;/c:detection&gt;&lt;c:prefix/&gt;&lt;c:exact&gt;Jack Bauer&lt;/c:exact&gt;&lt;c:suffix&gt; &amp;lt;jack@ctu.net&amp;gt; Rose Goodings&lt;/c:suffix&gt;&lt;c:offset&gt;0&lt;/c:offset&gt;&lt;c:length&gt;10&lt;/c:length&gt;&lt;/rdf:Description&gt;&lt;rdf:Description rdf:about="http://d.opencalais.com/dochash-1/e7b46664-fa0c-3da1-88f9-cb79fe0d6902/Relevance/1"&gt;&lt;rdf:type rdf:resource="http://s.opencalais.com/1/type/sys/RelevanceInfo"/&gt;&lt;c:docId rdf:resource="http://d.opencalais.com/dochash-1/e7b46664-fa0c-3da1-88f9-cb79fe0d6902"/&gt;&lt;c:subject rdf:resource="http://d.opencalais.com/pershash-1/a3100b92-7d3d-3f63-afcb-265678c15dcc"/&gt;&lt;c:relevance&gt;0.643&lt;/c:relevance&gt;&lt;/rdf:Description&gt;&lt;rdf:Description rdf:about="http://d.opencalais.com/genericHasher-1/b323806b-4832-375a-aec8-56343d47e2d2"&gt;&lt;rdf:type rdf:resource="http://s.opencalais.com/1/type/em/e/EmailAddress"/&gt;&lt;c:name&gt;r.good@testings.com&lt;/c:name&gt;&lt;/rdf:Description&gt;&lt;rdf:Description rdf:about="http://d.opencalais.com/dochash-1/e7b46664-fa0c-3da1-88f9-cb79fe0d6902/Instance/2"&gt;&lt;rdf:type rdf:resource="http://s.opencalais.com/1/type/sys/InstanceInfo"/&gt;&lt;c:docId rdf:resource="http://d.opencalais.com/dochash-1/e7b46664-fa0c-3da1-88f9-cb79fe0d6902"/&gt;&lt;c:subject rdf:resource="http://d.opencalais.com/genericHasher-1/b323806b-4832-375a-aec8-56343d47e2d2"/&gt;&lt;!--EmailAddress: r.good@testings.com; --&gt;&lt;c:detection&gt;[Bauer &amp;lt;jack@ctu.net&amp;gt; Rose Goodings &amp;lt;]r.good@testings.com[&amp;gt;]&lt;/c:detection&gt;&lt;c:prefix&gt;Bauer &amp;lt;jack@ctu.net&amp;gt; Rose Goodings &amp;lt;&lt;/c:prefix&gt;&lt;c:exact&gt;r.good@testings.com&lt;/c:exact&gt;&lt;c:suffix&gt;&amp;gt;&lt;/c:suffix&gt;&lt;c:offset&gt;41&lt;/c:offset&gt;&lt;c:length&gt;19&lt;/c:length&gt;&lt;/rdf:Description&gt;&lt;rdf:Description rdf:about="http://d.opencalais.com/dochash-1/e7b46664-fa0c-3da1-88f9-cb79fe0d6902/Relevance/2"&gt;&lt;rdf:type rdf:resource="http://s.opencalais.com/1/type/sys/RelevanceInfo"/&gt;&lt;c:docId rdf:resource="http://d.opencalais.com/dochash-1/e7b46664-fa0c-3da1-88f9-cb79fe0d6902"/&gt;&lt;c:subject rdf:resource="http://d.opencalais.com/genericHasher-1/b323806b-4832-375a-aec8-56343d47e2d2"/&gt;&lt;c:relevance&gt;0.643&lt;/c:relevance&gt;&lt;/rdf:Description&gt;&lt;rdf:Description rdf:about="http://d.opencalais.com/genericHasher-1/addbee66-556c-3a3a-b2d4-4c4c1e668261"&gt;&lt;rdf:type rdf:resource="http://s.opencalais.com/1/type/em/r/PersonEmailAddress"/&gt;&lt;!--Rose Goodings--&gt;&lt;c:person rdf:resource="http://d.opencalais.com/pershash-1/9f7b3610-9b76-34d4-8eea-3c2c0acbb31b"/&gt;&lt;!--r.good@testings.com--&gt;&lt;c:emailaddress rdf:resource="http://d.opencalais.com/genericHasher-1/b323806b-4832-375a-aec8-56343d47e2d2"/&gt;&lt;/rdf:Description&gt;&lt;rdf:Description rdf:about="http://d.opencalais.com/dochash-1/e7b46664-fa0c-3da1-88f9-cb79fe0d6902/Instance/3"&gt;&lt;rdf:type rdf:resource="http://s.opencalais.com/1/type/sys/InstanceInfo"/&gt;&lt;c:docId rdf:resource="http://d.opencalais.com/dochash-1/e7b46664-fa0c-3da1-88f9-cb79fe0d6902"/&gt;&lt;c:subject rdf:resource="http://d.opencalais.com/genericHasher-1/addbee66-556c-3a3a-b2d4-4c4c1e668261"/&gt;&lt;!--PersonEmailAddress: person: Rose Goodings; emailaddress: r.good@testings.com; --&gt;&lt;c:detection&gt;[Bauer &amp;lt;jack@ctu.net&amp;gt; ]Rose Goodings &amp;lt;r.good@testings.com[&amp;gt;]&lt;/c:detection&gt;&lt;c:prefix&gt;Bauer &amp;lt;jack@ctu.net&amp;gt; &lt;/c:prefix&gt;&lt;c:exact&gt;Rose Goodings &amp;lt;r.good@testings.com&lt;/c:exact&gt;&lt;c:suffix&gt;&amp;gt;&lt;/c:suffix&gt;&lt;c:offset&gt;26&lt;/c:offset&gt;&lt;c:length&gt;34&lt;/c:length&gt;&lt;/rdf:Description&gt;&lt;rdf:Description rdf:about="http://d.opencalais.com/pershash-1/9f7b3610-9b76-34d4-8eea-3c2c0acbb31b"&gt;&lt;rdf:type rdf:resource="http://s.opencalais.com/1/type/em/e/Person"/&gt;&lt;c:name&gt;Rose Goodings&lt;/c:name&gt;&lt;c:persontype&gt;N/A&lt;/c:persontype&gt;&lt;c:nationality&gt;N/A&lt;/c:nationality&gt;&lt;c:commonname&gt;Rose Goodings&lt;/c:commonname&gt;&lt;/rdf:Description&gt;&lt;rdf:Description rdf:about="http://d.opencalais.com/dochash-1/e7b46664-fa0c-3da1-88f9-cb79fe0d6902/Instance/4"&gt;&lt;rdf:type rdf:resource="http://s.opencalais.com/1/type/sys/InstanceInfo"/&gt;&lt;c:docId rdf:resource="http://d.opencalais.com/dochash-1/e7b46664-fa0c-3da1-88f9-cb79fe0d6902"/&gt;&lt;c:subject rdf:resource="http://d.opencalais.com/pershash-1/9f7b3610-9b76-34d4-8eea-3c2c0acbb31b"/&gt;&lt;!--Person: Rose Goodings; --&gt;&lt;c:detection&gt;[Bauer &amp;lt;jack@ctu.net&amp;gt; ]Rose Goodings[ &amp;lt;r.good@testings.com&amp;gt;]&lt;/c:detection&gt;&lt;c:prefix&gt;Bauer &amp;lt;jack@ctu.net&amp;gt; &lt;/c:prefix&gt;&lt;c:exact&gt;Rose Goodings&lt;/c:exact&gt;&lt;c:suffix&gt; &amp;lt;r.good@testings.com&amp;gt;&lt;/c:suffix&gt;&lt;c:offset&gt;26&lt;/c:offset&gt;&lt;c:length&gt;13&lt;/c:length&gt;&lt;/rdf:Description&gt;&lt;rdf:Description rdf:about="http://d.opencalais.com/dochash-1/e7b46664-fa0c-3da1-88f9-cb79fe0d6902/Relevance/3"&gt;&lt;rdf:type rdf:resource="http://s.opencalais.com/1/type/sys/RelevanceInfo"/&gt;&lt;c:docId rdf:resource="http://d.opencalais.com/dochash-1/e7b46664-fa0c-3da1-88f9-cb79fe0d6902"/&gt;&lt;c:subject rdf:resource="http://d.opencalais.com/pershash-1/9f7b3610-9b76-34d4-8eea-3c2c0acbb31b"/&gt;&lt;c:relevance&gt;0.643&lt;/c:relevance&gt;&lt;/rdf:Description&gt;&lt;rdf:Description rdf:about="http://d.opencalais.com/genericHasher-1/8c80538c-84d5-3394-a452-81a59a5eb11a"&gt;&lt;rdf:type rdf:resource="http://s.opencalais.com/1/type/em/e/EmailAddress"/&gt;&lt;c:name&gt;jack@ctu.net&lt;/c:name&gt;&lt;/rdf:Description&gt;&lt;rdf:Description rdf:about="http://d.opencalais.com/dochash-1/e7b46664-fa0c-3da1-88f9-cb79fe0d6902/Instance/5"&gt;&lt;rdf:type rdf:resource="http://s.opencalais.com/1/type/sys/InstanceInfo"/&gt;&lt;c:docId rdf:resource="http://d.opencalais.com/dochash-1/e7b46664-fa0c-3da1-88f9-cb79fe0d6902"/&gt;&lt;c:subject rdf:resource="http://d.opencalais.com/genericHasher-1/8c80538c-84d5-3394-a452-81a59a5eb11a"/&gt;&lt;!--EmailAddress: jack@ctu.net; --&gt;&lt;c:detection&gt;[Jack Bauer &amp;lt;]jack@ctu.net[&amp;gt; Rose Goodings &amp;lt;r.good@testings.com&amp;gt;]&lt;/c:detection&gt;&lt;c:prefix&gt;Jack Bauer &amp;lt;&lt;/c:prefix&gt;&lt;c:exact&gt;jack@ctu.net&lt;/c:exact&gt;&lt;c:suffix&gt;&amp;gt; Rose Goodings &amp;lt;r.good@testings.com&amp;gt;&lt;/c:suffix&gt;&lt;c:offset&gt;12&lt;/c:offset&gt;&lt;c:length&gt;12&lt;/c:length&gt;&lt;/rdf:Description&gt;&lt;rdf:Description rdf:about="http://d.opencalais.com/dochash-1/e7b46664-fa0c-3da1-88f9-cb79fe0d6902/Relevance/4"&gt;&lt;rdf:type rdf:resource="http://s.opencalais.com/1/type/sys/RelevanceInfo"/&gt;&lt;c:docId rdf:resource="http://d.opencalais.com/dochash-1/e7b46664-fa0c-3da1-88f9-cb79fe0d6902"/&gt;&lt;c:subject rdf:resource="http://d.opencalais.com/genericHasher-1/8c80538c-84d5-3394-a452-81a59a5eb11a"/&gt;&lt;c:relevance&gt;0.643&lt;/c:relevance&gt;&lt;/rdf:Description&gt;&lt;rdf:Description rdf:about="http://d.opencalais.com/genericHasher-1/a7bd9537-999f-3821-8858-c57f10ecd18d"&gt;&lt;rdf:type rdf:resource="http://s.opencalais.com/1/type/em/r/PersonEmailAddress"/&gt;&lt;!--Jack Bauer--&gt;&lt;c:person rdf:resource="http://d.opencalais.com/pershash-1/a3100b92-7d3d-3f63-afcb-265678c15dcc"/&gt;&lt;!--jack@ctu.net--&gt;&lt;c:emailaddress rdf:resource="http://d.opencalais.com/genericHasher-1/8c80538c-84d5-3394-a452-81a59a5eb11a"/&gt;&lt;/rdf:Description&gt;&lt;rdf:Description rdf:about="http://d.opencalais.com/dochash-1/e7b46664-fa0c-3da1-88f9-cb79fe0d6902/Instance/6"&gt;&lt;rdf:type rdf:resource="http://s.opencalais.com/1/type/sys/InstanceInfo"/&gt;&lt;c:docId rdf:resource="http://d.opencalais.com/dochash-1/e7b46664-fa0c-3da1-88f9-cb79fe0d6902"/&gt;&lt;c:subject rdf:resource="http://d.opencalais.com/genericHasher-1/a7bd9537-999f-3821-8858-c57f10ecd18d"/&gt;&lt;!--PersonEmailAddress: person: Jack Bauer; emailaddress: jack@ctu.net; --&gt;&lt;c:detection&gt;[]Jack Bauer &amp;lt;jack@ctu.net[&amp;gt; Rose Goodings &amp;lt;r.good@testings.com&amp;gt;]&lt;/c:detection&gt;&lt;c:prefix/&gt;&lt;c:exact&gt;Jack Bauer &amp;lt;jack@ctu.net&lt;/c:exact&gt;&lt;c:suffix&gt;&amp;gt; Rose Goodings &amp;lt;r.good@testings.com&amp;gt;&lt;/c:suffix&gt;&lt;c:offset&gt;0&lt;/c:offset&gt;&lt;c:length&gt;24&lt;/c:length&gt;&lt;/rdf:Description&gt;&lt;/rdf:RDF&gt; </code></pre> <p>I also have the following (where the file contains the above text):</p> <pre><code> System.IO.StreamReader tr = new System.IO.StreamReader("C:/test.txt"); string s = tr.ReadToEnd(); Graph g = new Graph(); FileLoader.Load(g, "C:/test.txt"); </code></pre> <p>and i get the following Exception RDFParseException</p> <p>StringParser failed to parse the RDF string correctly, StringParser auto-detection guessed 'NTriples' but this failed to parse. RDF string may be malformed or StringParser may have guessed incorrectly</p> <p>I'm truly lost, please help </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload