简体   繁体   中英

How to parse arbitrary RDF IRI through javascript?

RDF IRI such as:

I know that RDF IRI returns RDF data.

I want to parse arbitrary RDF IRI and show it as a list on the page.

IRI (Internationalized Resource Identifier) is an extension of the URI. It does not return data, it is an identifier . There is also no "RDF" IRI/URI; all the URIs you list are "http" or "https" URIs. Parsing such a URI would mean splitting it into parts like "http", "www.w3.org", and "/1999/02/22-rdf-syntax-ns".

Usually the web server is configured to produce semantic data (in Turtle, RDF/XML, JSON-LD, RDFa etc.; you'd use content negotiation to get one of the formats you understand) when you navigate to URIs actually denoting a vocabulary, but it doesn't have to.

There are libraries for JS for working with RDF , but if you want to do this in a web page, with client-side JavaScript, you are out of luck ‒ JavaScript doesn't allow you to retrieve the content of a cross-domain page.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM