Sorry Mayank but this is the developers of RDFLib mailing list, not a users
assistance list. For these kind of questions, please use StackOverflow and
tag with [rdflib]. Thanks, Nick

On Tue, Feb 15, 2022 at 11:49 PM mayank Agarwal <mayaag...@gmail.com> wrote:

> Hello,
> I am able to generate my RDF triples in .ttl format. I would like to ask
> two things:
>
> 1. When I save my RDF triples in .ttl format. It is saved taking subject
> in alphabetical order (first number and then follow alphabetical order)
> Could you please check why it is so?
>
> 2. When I am trying to apply URIRef to handle rdf triples predicates(URIs)
> for which I am getting a warning message: 'Predicate' does not look like
> a valid URI, trying to serialize this will break.
> What Should I change?
>
> Attaching the screenshots and sample ttl file.
>
>
> my code snippet:
> def build_result_graph(triples):
>     """ Builds a rdf graph with the result triples """
>     EX=Namespace("http://www.w3.org/1999/02/22-rdf-syntax-ns#type";)
>     g = Graph()
>     for triple in triples:
>         g.bind('ex',EX)
>         g.bind('foaf', FOAF)
>         g.bind('schema', SDO)
>         g.bind('dcterms',DCTERMS)
>         subj = triple[0]
>         pred = triple[1]
>         objct =triple[2]
>         g.add((subj, OWL.Ontology, objct))
>    g.serialize(destination='file' + str(counter) + ".ttl", format='ttl'
>     return g
>
> --
> 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 rdflib-dev+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rdflib-dev/f39b95f9-2078-42f1-b2a4-f5622caaf3c1n%40googlegroups.com
> <https://groups.google.com/d/msgid/rdflib-dev/f39b95f9-2078-42f1-b2a4-f5622caaf3c1n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 rdflib-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rdflib-dev/CAP7nqh1%2B7SZrjUpe-ViDGfcpmPuMDNMrSu3K20%3DrekNq-H%3DcRQ%40mail.gmail.com.

Reply via email to