Presentation is loading. Please wait.

Presentation is loading. Please wait.

RDF formats for Linked Data by Mabi Harandi. RDF is not a format, it is a model for data So: It will provide supports for different formats like :  Turtle.

Similar presentations


Presentation on theme: "RDF formats for Linked Data by Mabi Harandi. RDF is not a format, it is a model for data So: It will provide supports for different formats like :  Turtle."— Presentation transcript:

1 RDF formats for Linked Data by Mabi Harandi

2 RDF is not a format, it is a model for data So: It will provide supports for different formats like :  Turtle —A simple, human-readable format  RDF/XML —The original RDF format in XML  RDFa —RDF embedded in HTML attributes  JSON-LD —A newer format aimed at web developers

3 Why different formats? And what is the point of these different formats?

4 Turtle —human-readable RDF it simply consists of subject, predicate, object followed by terminator.

5

6 Some points of Turtle To use any URI(Uniform Resource Identifier) it should be declared at first. If they are only different in objects, then different objects could be separated by commas. If they have the common subject it is possible not to repeat the same subject instead separate different predicate and object by semicolon.

7 Blank nodes: – Sometimes we know that something exists but we don’t know exactly its identity. How to represent them  _: these identifier will be thrown away while parsing is done and replaced with local blank identifier.  If there are more than blank node then: All the triples that has unknown subject will be in the brackets [rdf : type bio : woman; bio : livedIn geo : England ]

8 To abbreviate the URI, @base could be used. It defines the base URI and all relative URI will append to that. – As an example if @prefix ex:. is replaced with a base URIhttp://example.com/ @base.http://example.com/ Then it is possible to use relative URIs to replace any references to the ex: vocabulary. ex:Zoo would change to the relative URI. Rdf:type could be replaced with a

9 RDF/XML—RDF for enterprises

10 It was an original serialization format for RDF Due to some complexities of its formatting and its standardization prior to XML, it’s not used as much as before. Lots of enterprise users because of XML infrastructure are using this format.

11

12 How does the format look like? It seems it is series of triples that are connected head to tail. Subject followed by a predicate followed by an object URI or object literal This pattern could repeat each time, an object becomes a subject.

13 QNames They are prefixed URI which is defined as XML namespaces in the opening XML tag The same purpose like prefix naming schema in Turtle: to make shorter URI for reading restriction: a part after the colon should be a valid XML element name.

14 It also has a definition of a base URI to make abbreviation. By using the xml:base directive in the rdf:RDF tag, near the namespace declarations. So it replaces the ex: namespace declaration (xmlns:ex="http://example.com/") with a base declaration (xml:base="http://example.com").

15 RDFa—RDF in HTML

16 Isn’t it needed to have unstructured data as the structured one ? Data like telephone numbers, people’ names and product descriptions are unstructured but we would like them in structured format so RDFa is helping us to do that by having RDF in HTML Attributes

17 How is it done? A HTML page’s DOCTYPE is modified so RDFa parsers can quickly determine that the page is worth parsing HTML attributes are used to provide just enough information to create RDF triples when the page is parsed.

18

19 How is it working? A web browser that doesn’t know what RDFa is will simply ignore any HTML attributes it doesn’t understand A RDFa-aware system would display exactly the same text but also provide the RDF triple dbpedia:Bonobo rdf:type dbpedia-owl:Mammal. The resource attribute provides the subject the special typeof attribute provides the rdf:type predicate

20

21 How does it make shorter URIs? It is known as CURIEs: Compact URI Expressions They are technically an extension to RDF/XML’s Qnames – because they allow the part after the colon to have values that aren’t valid XML element names. CURIEs are a superset of QNames.

22 Examples of RDFa After searching for a movie then – links to reviews are present in the results After searching for a product – Its price is listed

23 JSON-LD—RDF for JavaScript Developers

24 JSON (JavaScript Object Notation) for Linking Data : – an RDF serialization format in JSON every major programming language has multiple libraries that can parse JSON

25

26 RDF triples in the @graph object @id identifies RDF subjects @type identifies the special rdf:type predicate – Other predicates are simply named as a string in quotes RDF objects are JSON objects – URI – a literal denoted by @value – data type or language information. Curly braces ({ and }) surround objects Square brackets ([ and ]) denote arrays

27 Issues related to web servers and published Linked Data

28 Some web browsers or other types of clients need additional support to properly display Linked Data content This is accomplished using the HTTP Content-Type header. The Content-Type header for Linked Data varies with the specific format used : text/turtle, rdf+xml

29 There is a point for content type of HTTP They are know as MIME types : Multipurpose Internet Mail Extensions encode multimedia email attachments as plain text during email transmission

30

31 File types and web servers

32 configure Apache # Directives to ensure RDF files are served as the appropriate Content-Type AddType text/turtle.ttl AddType application/rdf+xml.rdf AddType application/ld+json.jsonld AddType application/N-Triples.nt The directives may be added to your Apache instance’s httpd.conf file, vhost (virtual host) configuration files, or.htaccess files.

33 When you have limited control over Apache if you can’t configure Apache directly? –.htaccess file – Cpanel mod_asis – Apache handlers installed by default and is used to send a file as is

34 Summary Resource Description Framework (RDF) RDF and Linked Data how to find and use RDF vocabularies Four RDF serialization formats: – Turtle – RDF/XML – RDFa – JSON-LD


Download ppt "RDF formats for Linked Data by Mabi Harandi. RDF is not a format, it is a model for data So: It will provide supports for different formats like :  Turtle."

Similar presentations


Ads by Google