rdf

What is a striping error?

无人久伴 提交于 2019-12-13 15:52:29
问题 I'm trying to convert last.fm xml data into rdf using xslt and am getting this error: ERROR [http-8080-1] (RDFDefaultErrorHandler.java:40) - (line 3 column 24): {E202} Expecting XML start or end element(s). String data "Joseph Arthur" not allowed. Maybe a striping error. Can anyone explain to me what a striping error is, or in general what I'm doing wrong. The xslt code is here: <xsl:for-each select="/lfm/artists/artist"> <lfm:name><xsl:value-of select="name"/></lfm:name> </xsl:for-each> Here

What RDF patterns can be used to represent components and the percentage they make up?

。_饼干妹妹 提交于 2019-12-13 14:52:56
问题 I'd like to inventory my wine collection using RDF but am not sure how to specify that wine can contain percentages of several grape varietals. Below is an attempt to do so in Turtle syntax using rdf:bag. @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix vin: <http://example.org/wine#> . <http://example.org/wine/id#1001> a <http://example.org/wine/ns#red> ; vin:name "Quilceda Creek CVR" ; vin:vintage "2014"^^xsd:gYear ; vin

Java - Jena API - Output file

最后都变了- 提交于 2019-12-13 14:43:05
问题 I'm using Java and Jena API. I have a class Person with the datatype properties hasFirstName , hasLastName , hasDateOfBirth , hasGender . Here is how one person is represented in my RDF file. <rdf:Description rdf:about="http://www.fam.com/FAM#Bruno04/02/1980 "> <j.0:FAMhasGender>H</j.0:FAMhasGender> <j.0:FAMhasDateOfBirth>04/02/1980</j.0:FAMhasDateOfBirth> <j.0:FAMhasLastName>DS </j.0:FAMhasLastName> <j.0:FAMhasFirstName> Bruno</j.0:FAMhasFirstName> </rdf:Description> For each person whose

Querying the Linked Movie Database (LMDB) with SPARQL

馋奶兔 提交于 2019-12-13 14:09:43
问题 Given an RDF graph like this: :Matrix [rdfs:label] :The Matrix . :Matrix [movie:id] :23 . :Matrix [movie:actor] :Keanu Reaves . :Matrix [movie:actor] :Laurence Fishburne . :Die Hard 3 [rdfs:label] :Die Hard 3 . :Die Hard 3 [movie:id] :42 . :Die Hard 3 [movie:actor] :Bruce Willis . :Die Hard 3 [movie:actor] :Samuel L. Jackson . and a query like this: SELECT ?id ?name ?actor WHERE { ?instance movie:id ?id . ?instance rdfs:label ?name . ?instance movie:actor ?actor . } I would expect a result

SPARQL equivalent of a SQL select query?

这一生的挚爱 提交于 2019-12-13 09:52:41
问题 If I have a SQL table that can be queried like this: Select empname from mytable Where empid=1; What would an equivalent SPARQL query be? 回答1: As a few people have mentioned here and on your similar, previous question, you probably need to do some more reading about the nature of RDF-modeled data. For Stack Overflow, you definitely need to get into the habit of showing your input data and whatever code you have written so far , even if it isn't working perfectly. In that case, you need to

Get data from rdf file [duplicate]

a 夏天 提交于 2019-12-13 08:57:21
问题 This question already has an answer here : Closed 6 years ago . Possible Duplicate: Java - Using Jena APi - Get data from RDF file I'm using Java and Jena API. I have the class Person with the datatype properties hasFirstName , hasLastName , hasDateOfBirth , hasGender . Here is how one person is represented in my RDF file. <rdf:Description rdf:about="http://www.fam.com/FAM#Bruno04/02/1980 "> <j.0:FAMhasGender>H</j.0:FAMhasGender> <j.0:FAMhasDateOfBirth>04/02/1980</j.0:FAMhasDateOfBirth> <j.0

SPARQL and Rules for ontologies

别等时光非礼了梦想. 提交于 2019-12-13 08:56:32
问题 Is it possible to create if/then rules using SPARQL and infer new relationships on my data? For example, could I encode rules like the following? if (blood_sugar > 126 and blood_sugar < 500) then blood_sugar_level = High if (blood_sugar_level = High) then (service = adjust_insulin_dose) 回答1: The question really doesn't provide enough data to figure out exactly what you're trying to do, but you can certainly bind values based on particular conditions. For instance, the following query includes

RDF4j .ttl file filter IF statement

给你一囗甜甜゛ 提交于 2019-12-13 08:41:31
问题 I am having problem during compilation. Can you help to figure out the problem please? ` public static void main(String[] args) throws IOException { File dir = new File("C:data\\test"); String[] fileNames = dir.list(); FileWriter outFile = new FileWriter("out.ttl"); RDFWriter writer = org.eclipse.rdf4j.rio.Rio.createWriter(RDFFormat.TURTLE, outFile ); writer.startRDF(); for (String fileName : fileNames) { System.out.println("Reading from " + fileName); File f = new File(dir, fileName); Model

How to isolate a list of URIs in a RDF file using CONSTRUCT or DESCRIBE in SPARQL?

蓝咒 提交于 2019-12-13 08:22:42
问题 I'm trying to get only a list of URIs in RDF instead of a list of triples: PREFIX gr: <http://purl.org/goodrelations/v1#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> DESCRIBE ?product WHERE { ?product rdfs:subClassOf gr:ProductOrService . } Using SELECT , instead of DESCRIBE I receive only the subject (which I want), but not as an RDF but like a SPARQL Result with binds, vars, etc. Using CONSTRUCT , I can't specify only the ?product , as above, so the closest I can get is:

LinkedMDB SPARQL results with fewer results than expected?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-13 05:47:46
问题 Slide 14 of Ontology Alignment Discovery using Linked Open Data says that there are 50,603 actors in the LinkedMDB dataset. Using the following query, I get 2500. Who is wrong here?, Is there something missing in the query? Why do the slides count such a high number? This is the SPARQL query: select(count(distinct ?actors) as ?nActors) where { ?actors a <http://data.linkedmdb.org/resource/movie/actor> . } Results 回答1: Many public endpoints impose limits on queries in order to ensure that one