rdf

XSLT transformation from RDF to html

会有一股神秘感。 提交于 2019-12-22 08:20:26
问题 I am trying to transform an RDF file to HTML using XSLT. I am using the template that i've found on the web: http://snippets.dzone.com/posts/show/1164 <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:foo="http://purl.org/rss/1.0/"> <xsl:output method="html"/> <xsl:template match="/"> <xsl:apply-templates select="/rdf:RDF

How to extract RDF triples from XML file using an existing ontology?

孤街醉人 提交于 2019-12-22 06:49:03
问题 I am trying to extract RDF triples from XML files by using an existing ontology. I am using Java, and can use XPath to extract data from XML and Jena to read and write RDF documents and ontologies. How can I extract the relevant triples from the XML according to the existing ontology? 回答1: Forget about XPath to extract triples, it way easier and less problematic with Jena. You can use the interface SimpleSelector together with model.listStatements from Jena. In this example I am using

Why does the W3C RDF validator replace the RDF URI with its own?

隐身守侯 提交于 2019-12-22 06:46:44
问题 Let us say that we input the following RDF code to the W3C RDF validator at http://www.w3.org/RDF/Validator/. <?xml version="1.0" encoding="UTF-8"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" xmlns:uni="http://www.example.org/uni-ns#"> <rdf:Description rdf:about="949352"> <uni:name>Grigoris Antoniou</uni:name> <uni:title>Professor</uni:title> </rdf:Description> </rdf:RDF> Once I ask to parse the RDF code, I find that in the

Serving RDF representation of Java model with Spring MVC?

穿精又带淫゛_ 提交于 2019-12-21 21:26:33
问题 How can I serve an RDF representation of a Java model via Spring MVC? I have JSON and XML representations working using Spring's content negotiation mechanisms and would like to do the same for RDF. 回答1: Assuming that you are using annotation driven configuration for your MVC application, this actually could be quite simple. Using the W3C's Media Types Issues for Text RDF Formats as a guide for content type specification, it's quite easy to augment your existing solution. The real question is

SemWeb Library RDF parser for c#

守給你的承諾、 提交于 2019-12-21 21:22:24
问题 I'm trying to use a RDF library for c# called SemWeb but i'm not beeing able to read my rdf file, wich is 570 MB large because i can't seem to implement any of the examples they give and the documentation is a little poor. Does anyone use this library or another to parse RDF files? I need it urgently since i'm doing an university job that requires a parser to RDF. Thanks 回答1: To read a file using SemWeb is very simple, just use something like the following: MemoryStore mem = new MemoryStore()

Sparql query with Blank node can be complex

情到浓时终转凉″ 提交于 2019-12-21 12:41:21
问题 I read this blog article, Problems of the RDF model: Blank Nodes, and there's mentioned that using blank nodes can complicate the handling of data. Can you give me an example why using blank nodes is difficult to perform a SPARQL query? I do not understand the complexity of blank nodes. Can you explain me the meaning and semantics of an existential variable? I do not understand clearly this explanation given in the RDF Semantics Recommendation, 1.5. Blank Nodes as Existential Variables. 回答1:

Using the 'GRAPH' keyword in SPARQL to fetch remote graphs

有些话、适合烂在心里 提交于 2019-12-21 10:17:00
问题 I'm looking to use SPARQL for a relatively basic task: Given a FOAF graph, I'd like to parse the elements I find in there, get their tags (if they exist) and then, use those as new graphs from which to find information about those people. So for instance, you could imagine a simple use case where I want to run a SPARQL query to list all of my favorite foods (as per my FOAF file), and also the favorite foods of all my friends. Here is what this looks like at the moment. Note that for testing

OWL Property Restrictions vs. SHACL

六眼飞鱼酱① 提交于 2019-12-21 04:25:20
问题 Given a choice between OWL Property Restrictions and SHACL, is there any reason to choose the OWL approach any more? Particularly with respect to cardinality constraints, I'm wondering whether SHACL is considered to supercede OWL. The syntax appears similar, to my casual inspection. I am probably missing the purpose of OWL cardinality constraints. As part of an ontology, they should facilitate inferencing (a separate concern from validation). But how do cardinality constraints facilitate

OWL restrictions - defining classes that only contains properties with a specific property value

℡╲_俬逩灬. 提交于 2019-12-21 04:14:18
问题 I'm currently playing a bit with the OWL and especially with restrictions. I'm trying to create a query that does the following: Suppose that I have a class 'Cinema' that has a property 'movies' (that contains objects of type 'Movie'). The class 'Movie' contains a property named 'genre'. Now I want to create a class ActionCinemas that only has movies with the genre 'action'. I'm really not sure how to do this. I was thinking about doing something with intersections or the cardinality but I'm

Can RDF model a labeled property graph with edge properties?

最后都变了- 提交于 2019-12-20 15:11:32
问题 I wanted to model partner relationship like the following, which I expressed in the format of labeled property graph. I wanted to use RDF language to express the above graph, particularly I wanted to understand if I can express the label of the "loves" edge (which is an URI to an article/letter). I am new to RDF, and I know the RDF can easily express the node properties in the LPG, but is it possible to conveniently express the edge properties? A bit more context of this question: the reason