Questions tagged [rdflib]

RDFLib is a Python library for working with RDF. It supports parsers and serializers for different syntaxes (RDF/XML, N3, N-Triples, Turtle, TriX and RDFa) as well of remote and local SPARQL queries. Please do not use this tag for rdflib.js.

Resources

Please do not confuse the RDFLib Python library with the rdflib.js Javascript library.

439 questions
0
votes
1 answer

Remove Safely Reference in rdflib

If I have a rdflib.Uriref that point to a resource that I do not need any more. How can i remove it safely using rdflib. If for example I just remove all the triples that refer to it may be a could broke something like a Bnode that is a list.
vigte
  • 95
  • 1
  • 8
0
votes
2 answers

Extract Data from BNode

I'm using a SPARQL to extract a node from an RDF file, the node in the rdf file is as follows: Birds are a class of vertebrates. They are bipedal, warm-blooded, have a covering of feathers, and their front limbs are modified into…
Noor
  • 19,638
  • 38
  • 136
  • 254
0
votes
1 answer

Extracting Labels and comments from the RDF file using RDFlib in Python

I have the follow ontology: Article
Marcelo
  • 438
  • 5
  • 16
0
votes
1 answer

Canopy UnicodeEncodeError: 'ascii' codec can't encode characters in position 31-32: ordinal not in range(128)

I saw other questions with the same title, but they don't answer what I'm looking for. I have the native python 2.7.2 in my macbook OS X (mountain lion), and use the package RDFlib with no problem. Few days ago, I installed Canopy, which is a nice…
Marcelo
  • 438
  • 5
  • 16
0
votes
1 answer

OWL File Query Execution Error in RDFLIB

I'm trying to make SPARQL queries on an OWL file (see pastebin) but it is the first time I'm dealing with an OWL file, so I used RDFLIB in Python to make SPARQL queries. When i run the code I get an error (shown below code) which I do not…
0
votes
0 answers

isinstance assertion when trying to run SPARQL query with RDFlib

I'm trying to execute a SPARQL query using the Python library RDFlib, but I am getting an error. The error seems to be in the SPARQL, but I've validated it and it is valid. >>> import rdflib >>> import rdfextras >>> rdfextras.registerplugins() >>>…
Noor
  • 19,638
  • 38
  • 136
  • 254
0
votes
1 answer

allegrograph xsd float literals

I'm uploading triples to an AG store from a graph generated in python by rdflib. Some of the objects in my triples are floats, so I add them to the graph like this: Literal(float(float_value), datatype=XSD.float) When I serialize the graph using…
jjon
  • 680
  • 1
  • 8
  • 23
0
votes
1 answer

open existing postgresql store

I'm trying to write an RDF graph and store it on PostgreSQL (using Python's rdflib). I do this by opening the store which I have already created and opening a graph through this store. This process appears to work fine and I can write and query to…
0
votes
1 answer

Fetching RDF for a topic from Freebase

I am trying to replicate the example code in https://developers.google.com/freebase/v1/rdf-overview#rdf-documentation to obtain the RDF for a particular topic and store the result in rdflib. After setup, the url…
user1748083
  • 137
  • 6
0
votes
1 answer

rdflib in python tools for Visual Studio

I want to use rdflib in python tools for Visual Studio. I installed both python tools and rdflib. When I write import rdflib in my project (in a file *.py) and launch it, it returns an error invalid literal for int() with base 10: 'value' and…
user1460819
  • 2,052
  • 5
  • 26
  • 35
0
votes
2 answers

path not found installing rdflib

When I setup, I get: C:\Python27>python Lib\site-packages\rdflib-master\setup.py Traceback (most recent call last): File "Lib\site-packages\rdflib-master\setup.py", line 64, in version = find_version('rdflib/__init__.py') …
ockham
  • 29
  • 5
0
votes
1 answer

How to use FILTER to select data that does not matches

I am using rdflib in Python and running SPARQL SELECT queries to get relevant data. It is very easy to filter data for some criteria using FILTER command like FILTER regex(?pname,'"""+samplepersnalisedexpertise+"""',"i") described below, but if I…
imran
  • 199
  • 3
  • 11
-1
votes
1 answer

How to get only value "Tuýp_2" with sparql query and remove URIRef link "http://www.semanticweb.org/ngocv/ontologies/2020/5/hotrobenhtieuduong#Tuýp_2"

I'm new to rdflib I trying to get only the value Tuýp_2, not include the IRI http://www.semanticweb.org/ngocv/ontologies/2020/5/hotrobenhtieuduong#Tuýp_2 def testontology(): test = """PREFIX :…
ngocvy
  • 11
  • 3
-1
votes
1 answer

Python Rdflib. Error with the query

I'm really getting mad with this! I nead to create a query for a graph, using rdf lib. This is the query: queryCompetence = """prefix context: select ?score…
Alex
  • 149
  • 1
  • 6
-1
votes
1 answer

Same sparql not returning same results

I'm using the same sparql statement using two different clients but both are not returning the same results. The owl file is in rdf syntax and can be accessed here. This is the sparql statement: PREFIX wo: PREFIX rdf:…
Noor
  • 19,638
  • 38
  • 136
  • 254
1 2 3
29
30