2010-04-19 2 views
2

은 .NET에서 OpenCalais RDF를 구문 분석하는 방법입니다. dotnetRDF를 사용하고 있으며 오류가 계속 발생합니다. 생성 된 Rdf의 샘플은 http://viewer.opencalais.com/에서 찾을 수 있습니다. 솔직히 정말로 잃어 버렸고 정말 도움이됩니다. 당신이 다른 어떤 API를 사용하는 경우 돕거나 솔직히 정말 정말 에리카OpenCalais RDF in .NET

을 잃었어요대로 dotnetRDF 작업을 만드는 방법을 알고하십시오

<!--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.--><!--Relations: PersonEmailAddress 

EmailAddress: [email protected], [email protected] 
Person: Jack Bauer, Rose Goodings--><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:c="http://s.opencalais.com/1/pred/"><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"><rdf:type rdf:resource="http://s.opencalais.com/1/type/sys/DocInfo"/><c:document><![CDATA[Jack Bauer <[email protected]> 
Rose Goodings <[email protected]>]]></c:document><c:docTitle/><c:docDate>2010-04-20 07:03:23.998</c:docDate><c:externalMetadata c:caller="calaisbridge"/><c:submitter>calaisbridge</c:submitter></rdf:Description><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"><rdf:type rdf:resource="http://s.opencalais.com/1/type/sys/DocInfoMeta"/><c:docId rdf:resource="http://d.opencalais.com/dochash-1/e7b46664-fa0c-3da1-88f9-cb79fe0d6902"/><c:submitterCode>416dcd8a-766f-0aa3-d94c-e5034b6ffc98</c:submitterCode><c:signature>digestalg-1|Kjq/y7thehi10hbBQ5v42YxE8n0=|a2DMjGG4mKEGTlIvvCvOg+BG1sCDrMZFSfRBjOBXMHwGtfLknC1nAQ==</c:signature></rdf:Description><rdf:Description rdf:about="http://d.opencalais.com/dochash-1/e7b46664-fa0c-3da1-88f9-cb79fe0d6902/lid/DefaultLangId"><rdf:type rdf:resource="http://s.opencalais.com/1/type/lid/DefaultLangId"/><c:docId rdf:resource="http://d.opencalais.com/dochash-1/e7b46664-fa0c-3da1-88f9-cb79fe0d6902"/><c:lang rdf:resource="http://d.opencalais.com/lid/DefaultLangId/InputTextTooShort"/></rdf:Description><rdf:Description rdf:about="http://d.opencalais.com/pershash-1/a3100b92-7d3d-3f63-afcb-265678c15dcc"><rdf:type rdf:resource="http://s.opencalais.com/1/type/em/e/Person"/><c:name>Jack Bauer</c:name><c:persontype>N/A</c:persontype><c:nationality>N/A</c:nationality><c:commonname>Jack Bauer</c:commonname></rdf:Description><rdf:Description rdf:about="http://d.opencalais.com/dochash-1/e7b46664-fa0c-3da1-88f9-cb79fe0d6902/Instance/1"><rdf:type rdf:resource="http://s.opencalais.com/1/type/sys/InstanceInfo"/><c:docId rdf:resource="http://d.opencalais.com/dochash-1/e7b46664-fa0c-3da1-88f9-cb79fe0d6902"/><c:subject rdf:resource="http://d.opencalais.com/pershash-1/a3100b92-7d3d-3f63-afcb-265678c15dcc"/><!--Person: Jack Bauer; --><c:detection>[]Jack Bauer[ &lt;[email protected]&gt; 
Rose Goodings]</c:detection><c:prefix/><c:exact>Jack Bauer</c:exact><c:suffix> &lt;[email protected]&gt; 
Rose Goodings</c:suffix><c:offset>0</c:offset><c:length>10</c:length></rdf:Description><rdf:Description rdf:about="http://d.opencalais.com/dochash-1/e7b46664-fa0c-3da1-88f9-cb79fe0d6902/Relevance/1"><rdf:type rdf:resource="http://s.opencalais.com/1/type/sys/RelevanceInfo"/><c:docId rdf:resource="http://d.opencalais.com/dochash-1/e7b46664-fa0c-3da1-88f9-cb79fe0d6902"/><c:subject rdf:resource="http://d.opencalais.com/pershash-1/a3100b92-7d3d-3f63-afcb-265678c15dcc"/><c:relevance>0.643</c:relevance></rdf:Description><rdf:Description rdf:about="http://d.opencalais.com/genericHasher-1/b323806b-4832-375a-aec8-56343d47e2d2"><rdf:type rdf:resource="http://s.opencalais.com/1/type/em/e/EmailAddress"/><c:name>[email protected]</c:name></rdf:Description><rdf:Description rdf:about="http://d.opencalais.com/dochash-1/e7b46664-fa0c-3da1-88f9-cb79fe0d6902/Instance/2"><rdf:type rdf:resource="http://s.opencalais.com/1/type/sys/InstanceInfo"/><c:docId rdf:resource="http://d.opencalais.com/dochash-1/e7b46664-fa0c-3da1-88f9-cb79fe0d6902"/><c:subject rdf:resource="http://d.opencalais.com/genericHasher-1/b323806b-4832-375a-aec8-56343d47e2d2"/><!--EmailAddress: [email protected]; --><c:detection>[Bauer &lt;[email protected]&gt; 
Rose Goodings &lt;][email protected][&gt;]</c:detection><c:prefix>Bauer &lt;[email protected]&gt; 
Rose Goodings &lt;</c:prefix><c:exact>[email protected]</c:exact><c:suffix>&gt;</c:suffix><c:offset>41</c:offset><c:length>19</c:length></rdf:Description><rdf:Description rdf:about="http://d.opencalais.com/dochash-1/e7b46664-fa0c-3da1-88f9-cb79fe0d6902/Relevance/2"><rdf:type rdf:resource="http://s.opencalais.com/1/type/sys/RelevanceInfo"/><c:docId rdf:resource="http://d.opencalais.com/dochash-1/e7b46664-fa0c-3da1-88f9-cb79fe0d6902"/><c:subject rdf:resource="http://d.opencalais.com/genericHasher-1/b323806b-4832-375a-aec8-56343d47e2d2"/><c:relevance>0.643</c:relevance></rdf:Description><rdf:Description rdf:about="http://d.opencalais.com/genericHasher-1/addbee66-556c-3a3a-b2d4-4c4c1e668261"><rdf:type rdf:resource="http://s.opencalais.com/1/type/em/r/PersonEmailAddress"/><!--Rose Goodings--><c:person rdf:resource="http://d.opencalais.com/pershash-1/9f7b3610-9b76-34d4-8eea-3c2c0acbb31b"/><[email protected]><c:emailaddress rdf:resource="http://d.opencalais.com/genericHasher-1/b323806b-4832-375a-aec8-56343d47e2d2"/></rdf:Description><rdf:Description rdf:about="http://d.opencalais.com/dochash-1/e7b46664-fa0c-3da1-88f9-cb79fe0d6902/Instance/3"><rdf:type rdf:resource="http://s.opencalais.com/1/type/sys/InstanceInfo"/><c:docId rdf:resource="http://d.opencalais.com/dochash-1/e7b46664-fa0c-3da1-88f9-cb79fe0d6902"/><c:subject rdf:resource="http://d.opencalais.com/genericHasher-1/addbee66-556c-3a3a-b2d4-4c4c1e668261"/><!--PersonEmailAddress: person: Rose Goodings; emailaddress: [email protected]; --><c:detection>[Bauer &lt;[email protected]&gt; 
]Rose Goodings &lt;[email protected][&gt;]</c:detection><c:prefix>Bauer &lt;[email protected]&gt; 
</c:prefix><c:exact>Rose Goodings &lt;[email protected]</c:exact><c:suffix>&gt;</c:suffix><c:offset>26</c:offset><c:length>34</c:length></rdf:Description><rdf:Description rdf:about="http://d.opencalais.com/pershash-1/9f7b3610-9b76-34d4-8eea-3c2c0acbb31b"><rdf:type rdf:resource="http://s.opencalais.com/1/type/em/e/Person"/><c:name>Rose Goodings</c:name><c:persontype>N/A</c:persontype><c:nationality>N/A</c:nationality><c:commonname>Rose Goodings</c:commonname></rdf:Description><rdf:Description rdf:about="http://d.opencalais.com/dochash-1/e7b46664-fa0c-3da1-88f9-cb79fe0d6902/Instance/4"><rdf:type rdf:resource="http://s.opencalais.com/1/type/sys/InstanceInfo"/><c:docId rdf:resource="http://d.opencalais.com/dochash-1/e7b46664-fa0c-3da1-88f9-cb79fe0d6902"/><c:subject rdf:resource="http://d.opencalais.com/pershash-1/9f7b3610-9b76-34d4-8eea-3c2c0acbb31b"/><!--Person: Rose Goodings; --><c:detection>[Bauer &lt;[email protected]&gt; 
]Rose Goodings[ &lt;[email protected]&gt;]</c:detection><c:prefix>Bauer &lt;[email protected]&gt; 
</c:prefix><c:exact>Rose Goodings</c:exact><c:suffix> &lt;[email protected]&gt;</c:suffix><c:offset>26</c:offset><c:length>13</c:length></rdf:Description><rdf:Description rdf:about="http://d.opencalais.com/dochash-1/e7b46664-fa0c-3da1-88f9-cb79fe0d6902/Relevance/3"><rdf:type rdf:resource="http://s.opencalais.com/1/type/sys/RelevanceInfo"/><c:docId rdf:resource="http://d.opencalais.com/dochash-1/e7b46664-fa0c-3da1-88f9-cb79fe0d6902"/><c:subject rdf:resource="http://d.opencalais.com/pershash-1/9f7b3610-9b76-34d4-8eea-3c2c0acbb31b"/><c:relevance>0.643</c:relevance></rdf:Description><rdf:Description rdf:about="http://d.opencalais.com/genericHasher-1/8c80538c-84d5-3394-a452-81a59a5eb11a"><rdf:type rdf:resource="http://s.opencalais.com/1/type/em/e/EmailAddress"/><c:name>[email protected]</c:name></rdf:Description><rdf:Description rdf:about="http://d.opencalais.com/dochash-1/e7b46664-fa0c-3da1-88f9-cb79fe0d6902/Instance/5"><rdf:type rdf:resource="http://s.opencalais.com/1/type/sys/InstanceInfo"/><c:docId rdf:resource="http://d.opencalais.com/dochash-1/e7b46664-fa0c-3da1-88f9-cb79fe0d6902"/><c:subject rdf:resource="http://d.opencalais.com/genericHasher-1/8c80538c-84d5-3394-a452-81a59a5eb11a"/><!--EmailAddress: [email protected]; --><c:detection>[Jack Bauer &lt;][email protected][&gt; 
Rose Goodings &lt;[email protected]&gt;]</c:detection><c:prefix>Jack Bauer &lt;</c:prefix><c:exact>[email protected]</c:exact><c:suffix>&gt; 
Rose Goodings &lt;[email protected]&gt;</c:suffix><c:offset>12</c:offset><c:length>12</c:length></rdf:Description><rdf:Description rdf:about="http://d.opencalais.com/dochash-1/e7b46664-fa0c-3da1-88f9-cb79fe0d6902/Relevance/4"><rdf:type rdf:resource="http://s.opencalais.com/1/type/sys/RelevanceInfo"/><c:docId rdf:resource="http://d.opencalais.com/dochash-1/e7b46664-fa0c-3da1-88f9-cb79fe0d6902"/><c:subject rdf:resource="http://d.opencalais.com/genericHasher-1/8c80538c-84d5-3394-a452-81a59a5eb11a"/><c:relevance>0.643</c:relevance></rdf:Description><rdf:Description rdf:about="http://d.opencalais.com/genericHasher-1/a7bd9537-999f-3821-8858-c57f10ecd18d"><rdf:type rdf:resource="http://s.opencalais.com/1/type/em/r/PersonEmailAddress"/><!--Jack Bauer--><c:person rdf:resource="http://d.opencalais.com/pershash-1/a3100b92-7d3d-3f63-afcb-265678c15dcc"/><[email protected]><c:emailaddress rdf:resource="http://d.opencalais.com/genericHasher-1/8c80538c-84d5-3394-a452-81a59a5eb11a"/></rdf:Description><rdf:Description rdf:about="http://d.opencalais.com/dochash-1/e7b46664-fa0c-3da1-88f9-cb79fe0d6902/Instance/6"><rdf:type rdf:resource="http://s.opencalais.com/1/type/sys/InstanceInfo"/><c:docId rdf:resource="http://d.opencalais.com/dochash-1/e7b46664-fa0c-3da1-88f9-cb79fe0d6902"/><c:subject rdf:resource="http://d.opencalais.com/genericHasher-1/a7bd9537-999f-3821-8858-c57f10ecd18d"/><!--PersonEmailAddress: person: Jack Bauer; emailaddress: [email protected]; --><c:detection>[]Jack Bauer &lt;[email protected][&gt; 
Rose Goodings &lt;[email protected]&gt;]</c:detection><c:prefix/><c:exact>Jack Bauer &lt;[email protected]</c:exact><c:suffix>&gt; 
Rose Goodings &lt;[email protected]&gt;</c:suffix><c:offset>0</c:offset><c:length>24</c:length></rdf:Description></rdf:RDF> 

또한이 다음 (파일이 위의 텍스트가 포함 된 경우) :

 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"); 

그리고 난 예외 RDFParseException에게 다음과 같은 얻을

StringParser 올바르게, StringParser 자동 detectio를 RDF 문자열을 구문 분석하는 데 실패 n은 'NTriples'를 추측했지만 이것은 구문 분석에 실패했습니다. RDF 문자열의 형식이 잘못되거나 StringParser, 지금은 오른쪽 버그가 RDF/XML 파서가 어떤 상황에서 제대로 CDATA 요소를 처리하지 않도록 관련이

+0

어떤 에러가 표시됩니까? 그리고 파싱하려는 샘플을 제공 할 수 있습니까? 그 양식에서 얻은 출력은 w3c rdf 유효성 검사기로 잘 작동했습니다. – user205512

+0

나는 w3c rdf 유효성 검사기를 시도했지만 dotnetRDF와 같은 소프트웨어를 사용하여 구문 분석을 시도했을 때 간단히 작동하지 않았습니다! 곧 샘플을 추가 할 것입니다. – Erika

+0

RDF/XML 파서와 관련된 dotNetRDF의 버그를 수정했으며 샘플 응용 프로그램이 작동하지 않는 이유를 확인했습니다. 더 많은 도움이 필요하면 알려주세요. – RobV

답변

1

,이해야 도와주세요 잘못

내가 정말 잃었어요

을 추측 할 수있다 당신이 다시 다운로드하고 지금은 잘 작동합니다 OpenCalais에서 RDF (I 희망)

나는 그것을 시도 할 경우 고정 내가 새로운 업로드 한 것은 모두 dotnetrdf.org 및 소스 포지 (SourceForge)

이 버그 수정과 라이브러리 빌드 가능한 한 빨리 버그를 수정하고 사용자를 지원하십시오.

[email protected]
[email protected]

: 뉴욕 더 문제는 내가보고 최대한 빨리 당신의 문제를 해결 할 수 있도록 나에게 메일 링리스트에 알려 주시기 바랍니다 편집이 t 다음 대신을 시도 RDF/XML에 대한

를 볼 것으로 예상 어떠한 <?xml version="1.0"?> 선언이 없기 때문에 제대로 데이터 형식을 감지하지 않는 예제 응용 프로그램 StringParser를 들어

O를 명시 적으로 사용하는 파서을 설정 파일에 읽기에 의해이 경우 대신 추측해야하는 파일 확장자에서 RDF/XML로 데이터 형식을 추측됩니다

FileLoader.Load(g, "C:\test.txt", new RdfXmlParser()); 

을 또는 대안 test.rdf에 파일 이름을 변경하고 원시 문자열에 간단한 정규 표현식을 쓰는 것

+1

감사합니다. <3 너는 정직하게 생명의 은인이다. 내가 무엇을해야 할지를 정말로 잃어 버렸기 때문이다. 도움과 도움을 많이 주셔서 고맙다. – Erika