Just deleted the value_node BNode and it worked

El lunes, 2 de septiembre de 2019, 12:35:49 (UTC+1), [email protected] 
escribió:
>
> Hi, i have a problem.
>
> I'm new with this RDFLIB on Python and i want to make and nested 
> structure, but i can't figure how to and what I'm doing wrong.
>
> Help please :D
>
> Thank you all :D
>
> I'm traying to create this:
>
> <dct:accrualPeriodicity>
> <dct:Frequency>
> <rdf:value>
> <time:DurationDescription>
> <rdfs:label>Daily</rdfs:label>
> <time:days rdf:datatype="http://www.w3.org/2001/XMLSchema#decimal";>1</time
> :days>
> </time:DurationDescription>
> </rdf:value>
> </dct:Frequency>
> </dct:accrualPeriodicity>
>
>
> but with this code i made i got this:
>
> <dct:accrualPeriodicity>
> <dct:Frequency rdf:nodeID="N2a442c84e6cd4ce6809cb50e4abac611">
> <rdf:value>
> <rdf:value rdf:nodeID="Nf6cc7775cfbd4ec0960ff0d13036ad9a">
> <time1:DurationDescription>
> <time1:DurationDescription rdf:nodeID="Ncc7a5147a77a4e9a9b2d0fca8581df2d">
> <rdfs:label>Daily</rdfs:label>
> <time1:days rdf:datatype="http://www.w3.org/2001/XMLSchema#integer";>1</
> time1:days>
> </time1:DurationDescription>
> </time1:DurationDescription>
> </rdf:value>
> </rdf:value>
> </dct:Frequency>
> </dct:accrualPeriodicity>
>
>
> This is the part of the code:
>
>
> if frequency is not None:
> frequency_details = BNode()
> value_node = BNode()
> duration_desc_node = BNode()
>
> # AccrualPeriodicity
> g.add((dataset_ref, DCT.accrualPeriodicity, frequency_details))
> # Frequency
> g.add((frequency_details, RDF.type, DCT.Frequency))
>
> # Value
> g.add((value_node, RDF.type, RDF.value))
> g.add((frequency_details, RDF.value, value_node))
>
> # DurationDescription Label and Time:X
> g.add((value_node, TIME.DurationDescription, duration_desc_node))
> g.add((duration_desc_node, RDF.type, TIME.DurationDescription))
> g.add((duration_desc_node, RDFS.label, Literal(frequency)))
> g.add((duration_desc_node, TIME.days, Literal(1)))
>
>

-- 
http://github.com/RDFLib
--- 
You received this message because you are subscribed to the Google Groups 
"rdflib-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rdflib-dev/84d92634-ec4a-47a0-8b1f-246828aa01e8%40googlegroups.com.

Reply via email to