Hello I need to obtain something like that:
@prefix semag: <
http://semagrow.eu/rdf/recom#> .
AGRIS_URI_1 semag:rel [
semag:order "1"^^xsd:integer ;
semag:recom <http:/
weburl1.com> ] .
<
http://weburl1.com> rdf:type semag:CrawledDocument .
AGRIS_URI_1 semag:rel [
semag:order "2"^^xsd:integer ;
semag:recom <http:/
weburl2.com> ] .
<
http://weburl2.com> rdf:type semag:CrawledDocument .
I have done that code:
final_g = Graph()
semag = Namespace("
http://semagrow.eu/rdf/recom#")
rdf = Namespace("
http://www.w3.org/2000/01/rdf-schema#")
relation = BNode()
order=1
for url, count in counter_urls:
g = Graph()
g.add( (Literal(uri), semag.rel, relation) )
g.add( (relation, semag.order, Literal(order)) )
g.add( (relation, semag.recom, Literal(url)) )
g.add( (Literal(url), rdf.type, semag.CrawledDocument) )
order += 1
final_g += g
And what I am obtaining is:
@prefix rdf: <
http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <
http://www.w3.org/2000/01/rdf-schema#> .
@prefix semag: <
http://semagrow.eu/rdf/recom#> .
@prefix xml: <
http://www.w3.org/XML/1998/namespace> .
@prefix xsd: <
http://www.w3.org/2001/XMLSchema#> .
"AGRIS_URI_1" semag:rel [ semag:order 1,
2 ;
semag:recom "
http://weburl1.com",
"
http://weburl2.com"] .
"
http://weburl1.com" rdfs:type semag:CrawledDocument .
"
http://weburl2.com" rdfs:type semag:CrawledDocument .
I want to have each instance separated and not one with everything that I do not know if it is equivalent.
Thanks a lot.
Regards.