Closed RichardPinka closed 3 years ago
Hello @RichardPinka ,
the containers were added in the current master branch but are not yet released. Probably you are using rdflib 5.0.0 which does not include containers.
When you install from the current master branch you will need to import Bag
from rdflib.container
as the following example shows:
from rdflib import Graph, BNode, Literal
from rdflib.container import Bag
g = Graph()
b = Bag(g, BNode(), [Literal("one"), Literal("two"), Literal("three")])
print(g.serialize(format="turtle"))
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
[] a rdf:Bag ;
rdf:_1 "one" ;
rdf:_2 "two" ;
rdf:_3 "three" .
A minor remark. Please directly paste your code and the relevant output into the issue. That makes it easier to reproduce your code.
Hello and thank you. Now, I just need to find out how the "current master branch" could be installed :) (sorry i am civil engineer, i like simple stuf like setup.exe for installing the stuff :) )
You can try it with
pip install git+https://github.com/RDFLib/rdflib@master
but be aware, the code in the master branch is not yet released and might be unstable
hello, Do You have please clue, why "Bag" is not working in module rdflib as you may see ?