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
    Unlike OO, these aren't restrictions, but assertions. If an object value of "jld:option" takes an object, then we can infer that it has class "jld:Option". People often overlay RDFS assertions on OO, and it sort of works, but it's sort of upside down.
    Regarding the credentialSubject the fact the the context (not vocabulary) say's it's of type @id means that string values of credentialSubject should be interpreted as IRIs, represented in expanded form as an object with a single @id property.
    If values are objects, themselves, or an array of objects, they will typically be node objects with their own explicit or implicit @id. Note that the context is not a schema language, just a way to make sure that values are interpreted properly.
    Felix Watts
    @felixwatts
    @gkellogg ok thanks for that. I will look into the Test vocaulary example. I think I've started with the misconception that JSON-LD is a schema definition language, whereas its actually a way for a datum to be self describing
    Colin Williams
    @KE7CFN_twitter
    I don't know terribly much about lson-ld or sparkQL. But I found an API that returns json-ld, and I'm wondering if I can write a sparkQL query against it, and if so maybe some examples of doing that. Given a json-ld response can we write a sparkQL query against it? Can we make these requests for remote resources?
    Gregg Kellogg
    @gkellogg
    Yes, you can treat JSON-LD as RDF (actually, as an RDF Dataset), and use it as either the implicit subject of the query, or explicitly load it using the FROM syntax. A reasonable SPARQL processor will parse the JSON-LD into an RDF Dataset. You can get the results using the ASK, DESCRIBE, SELECT or CONSTRUCT variations. Both DESCRIBE and CONSTRUCT generate an RDF graph, which you can typically get back as JSON-LD based on the details of a particular SPARQL endpoint.
    Typically, you might expect your API endpoint to offer a SPARQL service, but you can run one locally using any of a number of different SPARQL implementations.
    Colin Williams
    @KE7CFN_twitter
    @gkellogg , thanks. I was looking at https://www.weather.gov/documentation/services-web-api which mentions JSON-LD but don't happen to see any SPARQL service. However, I have an interest in writing SPARQL queries against the JSON-LD responses. Then I am looking into paring the json-ld into an RDF that I can query.
    Colin Williams
    @KE7CFN_twitter
    @gkellogg can you suggest a SPARQL processors that are capable of parsing JSON-LD directly?
    Stian Soiland-Reyes
    @stain
    @KE7CFN_twitter sounds like something you would do with Virtuoso - see http://uriburner.com/ for instance
    there you "load" it with a source URL and then you get a query endpoint for that one source. It gets more complicated when you want to combine multiple sources in a single dataset
    Adrian Gschwend
    @ktk
    @KE7CFN_twitter you might want to checkout https://comunica.linkeddatafragments.org/ as well
    this provides among others a SPARQL implementation in pure JS using RDFJS data structures. they are happy to load JSON-LD
    there are limits to scaling there but in general this should be enough for a start
    and FYI there is a gitter channel for it here
    Nicolaie Constantinescu
    @kosson
    Hello! Does any of you knows a good example or good practices of Europeana Data Model as JSON-LD?
    Andrew Berezovskyi
    @berezovskyi

    Hi everyone, I am looking for a tool that can take a JSON file (not a valid JSON-LD) plus a JSON-LD context as described in https://w3c.github.io/json-ld-syntax/#interpreting-json-as-json-ld and to output Turtle (or expanded JSON-LD or N-Triples, for example, so that it's easy to convert them to Turtle). I tried https://json-ld.org/playground/, http://rdf.greggkellogg.net/distiller, https://github.com/digitalbazaar/jsonld-cli but they all seem to be able to compact a JSON-LD context only when provided with a file that is already in JSON-LD format.

    My use-case is to take a JSON output of the tool that only produces JSON and might not wish to change it's output format but may add a JSON-LD context header if I provide them with the context definition. So, a tool that would allow to quickly see what kind of Turtle serialisation my context definition would provide is quite valueable for feedback.

    A library suggestion that allows this to be done is also welcome (I looked at https://github.com/ruby-rdf/json-ld but did not see a similar example). Thank you in advance!

    Gregg Kellogg
    @gkellogg
    You should be able to do this with the distiller, by setting the "expandContext" field to what you want to use, and use the "serialize" command with output format "turtle". If you need to do this in bulk, you can load the "json-ld" and "rdf-turtle" gems and use the "rdf" command line tool with appropriate arguments; the distiller just uses this.
    Andrew Berezovskyi
    @berezovskyi
    Thank you so much, Gregg! It works now. I initially tried JSON-LD format and JSON-LD output format with the expandContext and got 'undefined method `[]' for nil:NilClass' and did not to think to try JSON-LD to Turtle. I will also try to reproduce this with the 'rdf' CLI tool.
    Gregg Kellogg
    @gkellogg
    If you can give me specifics for reproducing the issue you noticed, I'll check it out.
    Adrian Gschwend
    @ktk
    @berezovskyi I did that in RDFJS JavaScript stack as well, not sure what your requirements are for language
    Jim Amsden
    @jamsden
    Gregg, I'm (with Andrew above) one of the members of the OASIS OSLC Open Project, and I'm also a member of OMG contributing to the SysML v2 work. I am exploring how to create a practicable, usable JSON-LD schema for SysML v2 and could use some guidance. I wonder if we could meet to discuss? The goal is to ensure SysML v2 is RDF and OSLC friendly, and we want to leverage JSON-LD as a means of doing that while providing consumable JSON for services API flexibility.
    Jim Amsden
    @jamsden
    @gkellogg I have a candidate JSON-LD context created from the SysML.uml XMI file created using Python. I just have a few questions about what might need to be modeled vs. what can be safely ignored. For example, UML scopes ownedAttributes in a Class, but RDF doesn't. That won't matter unless two classes use the same property name with a different type.
    Gregg Kellogg
    @gkellogg
    Hi @jamsden I’d be happy to chat online. I’m in California, so suggest a time an venue.
    Iwan Aucamp
    @aucampia
    hi
    I would like @id values that are usable as languages
    not sure what to use
    Gregg Kellogg
    @gkellogg
    @aucampia Values of @id are treated as IRIs or blank node identifiers due to the data model requirements. The @id identifies a node in a graph, and a language value (or really any literal) is not appropriate for this. You might use something that identifies a language, such as http://dbpedia.org/resource/English. but that's probably not what you're looking for.
    Iwan Aucamp
    @aucampia
    @gkellogg thanks for the exaplanation
    actually the DBPedia may be
    but I will just use Qs from wikidata
    Iwan Aucamp
    @aucampia
    hi
    anybody mixing json-ld with json-schema?
    Jim Amsden
    @jamsden
    json-ld and json-schema play very different, and possibly complimentary roles. json-ld provides information necessary to interpret JSON as RDF. RDF is based on open-world assumptions and does not use structure based schemas. json-schema however is used to specify constraints on what constitutes valid JSON in some context. In this case, json-schema plays a role for JSON similar to RDF constraint languages like SHACL or OSLC Resource Shapes does for RDF.
    @gkellogg The json-ld for SysML v2 has been resolved and implemented. So no further help needed.
    Jim Amsden
    @jamsden
    Has anyone noticed that Apache Jena has trouble parsing JSON-LD "@version": 1.1? If I quote the 1.1, it parses ok, but then that's not a valid version in JSON-LD playground.
    Gregg Kellogg
    @gkellogg
    Jena uses the https://github.com/jsonld-java/jsonld-java which has had a hard time getting resources to update for 1.1. There is another project, https://github.com/filip26/titanium-json-ld, which has very good conformance and perhaps should replace jsonld-java as the default Jena implementation.
    Iwan Aucamp
    @aucampia
    hi
    I want the data in Manifest to be interpreted as having the same subject as ResourceTypeID
    is there a way to do that?
    Maybe entailment and reasoning
    Iwan Aucamp
    @aucampia
    I can use @nest
    Gregg Kellogg
    @gkellogg
    Yes, looks like a good use for @nest. It's worth playing with it in the playground to easily see the effect of applying a context can be: https://tinyurl.com/y37v46o5
    Didac
    @umbreak

    Hi everyone. Is there a way to get the top most @id values on a JSON-LD document? I was trying framing like this:

    {
      "@id": {},
      "@explicit": true
    }

    But it will return everything which is an @id, does not matter if it is at the top of the document or where.

    Gregg Kellogg
    @gkellogg
    Not with framing; the concept of "first" is not really consistent with the graph data model anyway. Of course, you could do something with JSON Pointer.
    Didac
    @umbreak
    @gkellogg thanks. Yes I know there is nothing like “first” or “top” on a graph structure. But there is something like “top” on a tree structure like json.
    Gregg Kellogg
    @gkellogg
    Framing works by first flattening the input JSON and creating a map structure from subject to associated object. The top-level frame then matches against those objects. If that matches against more than one object, there will be multiple top-level entries, so there is no top-most object when flattening.
    But, maybe you can describe your use case further.