Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Gregg Kellogg
    @gkellogg
    A fool-proof way would be to turn the JSON-LD into RDF, and then back into JSON-LD. One area that may catch you up is if the data contains lists of lists, which 1.0 didn't support.
    Iwan Aucamp
    @aucampia
    I am trying to use jsonld 1.1 in rdflib, and I was looking at their to_rdf method, and it seems they first do expand and then process the expanded for, so I was thinking I could do the same somehow and then just use rdflib's json-ld 1.0 support. I will give flatten a try and see how I fare
    Iwan Aucamp
    @aucampia
    I was looking at pyld's to_rdf method I mean
    Iwan Aucamp
    @aucampia
    I'm wondering, should JSON-LD be able to deal with something like {"@context": {"example":"http://example.com"} "@id": "example:with space:"}
    $ echo '{"@context": {"example":"http://example.com/"}, "@id": "example:with space:", "example:key": "value"}' | rdfpipe -i json-ld -o turtle /dev/stdin 
    @prefix example: <http://example.com/> .
    
    Traceback (most recent call last):
      File "/home/iwana/.local/bin/rdfpipe", line 8, in <module>
        sys.exit(main())
      File "/home/iwana/.local/lib/python3.8/site-packages/rdflib/tools/rdfpipe.py", line 183, in main
        parse_and_serialize(args, opts.input_format, opts.guess,
      File "/home/iwana/.local/lib/python3.8/site-packages/rdflib/tools/rdfpipe.py", line 56, in parse_and_serialize
        graph.serialize(destination=outfile, format=output_format, **kws)
      File "/home/iwana/.local/lib/python3.8/site-packages/rdflib/graph.py", line 968, in serialize
        serializer.serialize(stream, base=base, encoding=encoding, **args)
      File "/home/iwana/.local/lib/python3.8/site-packages/rdflib/plugins/serializers/turtle.py", line 247, in serialize
        if self.statement(subject) and not firstTime:
      File "/home/iwana/.local/lib/python3.8/site-packages/rdflib/plugins/serializers/turtle.py", line 314, in statement
        return self.s_squared(subject) or self.s_default(subject)
      File "/home/iwana/.local/lib/python3.8/site-packages/rdflib/plugins/serializers/turtle.py", line 318, in s_default
        self.path(subject, SUBJECT)
      File "/home/iwana/.local/lib/python3.8/site-packages/rdflib/plugins/serializers/turtle.py", line 333, in path
        or self.p_default(node, position, newline)):
      File "/home/iwana/.local/lib/python3.8/site-packages/rdflib/plugins/serializers/turtle.py", line 339, in p_default
        self.write(self.label(node, position))
      File "/home/iwana/.local/lib/python3.8/site-packages/rdflib/plugins/serializers/turtle.py", line 355, in label
        return self.getQName(node, position == VERB) or node.n3()
      File "/home/iwana/.local/lib/python3.8/site-packages/rdflib/term.py", line 254, in n3
        raise Exception('"%s" does not look like a valid URI, I cannot serialize this as N3/Turtle. Perhaps you wanted to urlencode it?'%self)
    Exception: "http://example.com/with space:" does not look like a valid URI, I cannot serialize this as N3/Turtle. Perhaps you wanted to urlencode it?
    {"@context": {"example":"http://example.com/"}, "@id": "example:with space:", "example:key": "value"}
    I guess not :think:
    Why can't people just use URIs :(
    why do they have to go invent their own thing
    Iwan Aucamp
    @aucampia
    I will hack rdflib to make it work for now I guess
    just URLescape the fragment after the prefix
    so annoying
    thanks for all the help by the way Gregg
    Didac
    @umbreak

    Hi everyone. I have a question concerning the returned @context when framing.

    I could find that for compact, on the JsonLdProcessor 9.3 says:

    If context was not null, add an @context entry to compacted output and set its value to the provided context.

    But I could not find anything similar in framing. So If I pass the following json

    {
       "@id": "http://schema.org/myId",
       "@type": "http://schema.org/mytype"
    }

    With the following framing:

    {
       "@id": "http://schema.org/myId",
       "@context": "http://schema.org/"
    }

    Where in the algorithm says if I should expect the response to contain the same @context as the framing or the resolved @context (so all the schema.org context) ?

    Iwan Aucamp
    @aucampia
    any inputs here: digitalbazaar/pyld#137 ?
    Iwan Aucamp
    @aucampia
    Made a PR, any feedback is welcome: digitalbazaar/pyld#138
    Didac
    @umbreak
    I guess I found it, in the JsonLdProcessor step 19.3
    Jonathan
    @johnthu_twitter
    hi friends, if I want to extract json-ld info from some web pages, what could be easiest method?
    Gregg Kellogg
    @gkellogg
    JSON-LD 1.1 specifies how to extract JSON-LD from HTML; the Ruby tool (which you can demo through http://rdf.greggkellogg.net/distiller) does this. I don't believe that support has been incorporated into jsonld.js or pyld quite yet; work's done, but, there are some packaging considerations they need to work out. /cc @davidlehn
    Didac
    @umbreak
    Is someone mantaining the Json-LD Java present here? I’d like them to review&merge the PR that fixes an issue with recursive remoteContexts: jsonld-java/jsonld-java#303
    iwan.aucamp
    @iwan.aucamp:matrix.org
    [m]
    Iwan Aucamp
    @aucampia
    ah, well, that is awkward
    Iyanuoluwa (Elijah) Raji
    @iraji1
    Hey Everyone, I've been trying to build out a JSON-LD Sample based on some dummy data and I'm having issues. Is there anyone that can assist
    Iwan Aucamp
    @aucampia
    @iraji1 I'm sure there is someone that can help, but you have to say what the problem is
    gnoric
    @gnoric
    Hi guys, anyone here? I got a question for you json-ld experts :)
    is there any way (including frames) to inherit a relationship, say: if child of, and child of, then grandchild of! Or is the only way to modify the original json?
    {
        "@id"     : "Model 1",
        "@type"    : "abc:model",
        "entities" : [
            {
                "@id"     : "Entity 1",
                "@type"    : "abc:entitiy",
                "attributes" : [
                    {
                        "@id"     : "Attribute 1",
                        "@type"    : "abc:attribute"
                    }
                ]
            }
        ]
    }
    gnoric
    @gnoric
    is there any possibility to say that Attribute 1 is in Model 1 without altering the json?
    Gregg Kellogg
    @gkellogg
    I answered the question in a private response. Might want to work in the RDF domain with RDFS/OWL inferrence or SPARQL Update then re-serialize as JSON-LD.
    gnoric
    @gnoric
    @gkellogg Thank you so much for taking the time to respond! <3
    Blake Regalia
    @blake-regalia
    does anyone recall discussions about the term canonicalization vs normalization and why one is preferred over the other ?
    Gregg Kellogg
    @gkellogg
    Regarding federated queries; JSON-LD isn't really a query language (although framing includes some filtering aspects). SPARQL is the appropriate standard to look to for doing federated queries, and the results can be formatted as JSON-LD.
    Re canonicalization vs. normalization, I consider them to be synonyms, with canonicalization (C14N) more common. There is a proposed Working Group that would include this work: https://w3c.github.io/lds-wg-charter/, which now uses the RDF Dataset Canonicalization naming, rather than the former RDF Dataset Normalization naming.
    Mark Foster
    @mfosterio
    @gkellogg Can JSON-LD be converted to rdfs and then queried by SPARQL?
    Mark Foster
    @mfosterio
    @gkellogg I am still learning these technologies. I was assuming that the conversion to N-Quads was triples with a graph dimension. https://json-ld.org/playground/ https://stackoverflow.com/questions/38112473/how-to-import-and-query-4-column-n-quad-quadruples-into-blazegraph
    Adrian Gschwend
    @ktk
    @mikcaweb JSON-LD is RDF and you can load it to most stores that provide SPARQL
    RDFS is the schema part, RDF is the "model" itself
    and yes N-Quads is N-Triples plus a graph IRI
    Iwan Aucamp
    @aucampia
    @mikcaweb but you can write RDFS in JSON-LD, as RDFS is just RDF, and JSON-LD is an encoding of RDF. So you cannot exactly convert JSON-LD to RDFS, but you can encode an RDF schema in JSON-LD
    Iwan Aucamp
    @aucampia
    RDFLib has this issue: RDFLib/rdflib#1443 (json-ld parser adds trailing slash to URLs that have no path) and there is this attempted fix RDFLib/rdflib#1456 (Fix JSON-LD data import adds trailing slashes to IRIs (#1443) #1456)

    So I think in part the issue is that the logic in RDFLib is not this:

    https://www.w3.org/TR/json-ld11/#type-coercion

    If no matching term is found in the active context, it tries to expand it as an IRI or a compact IRI if there's a colon in the value; otherwise, it will expand the value using the active context's vocabulary mapping, if present. Values coerced to @id in contrast are expanded as an IRI or a compact IRI if a colon is present; otherwise, they are interpreted as relative IRI references.

    .

    But I can't find the normative content which covers this
    nevermind it is this https://www.w3.org/TR/json-ld-api/
    Iwan Aucamp
    @aucampia
    can I somehow add comments to json-ld - I want to add an element which should be ingored by the processor
    I will go for @_comment for now
    Iwan Aucamp
    @aucampia
    okay I went for @x-comment - seems to be okay for riot and jsonld-cli
    Gregg Kellogg
    @gkellogg
    Its a common solution, althoughit. Ay raise warnings if a processor.
    haciendalosolivos
    @haciendalosolivos:matrix.org
    [m]
    Hello everyone. A very dumb question. I have a site of my own made with wix.com I know 0 about programming. I am aware of the importance of linked data in order for search engines to relate contents and obtain more visibility. However I am wondering if the effort to use JSN-LD properly in my site it is worth it. I repeat. I know 0 about it. My website is a Rural House and I am happy with it. Thank you very much.
    2 replies
    Gregg Kellogg
    @gkellogg
    Generally, it depends on your goals. If you want search engines to be able to pick up pertinent information, then you might look at the examples at https://schema.org, and apply those patterns to your own site. Many people find JSON-LD script blocks the easiest way to add semantic information to their websites.
    2 replies