New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more export formats (e.g. as offered but obsolete at schema.rdfs.org) #208

Open
danbri opened this Issue Dec 28, 2014 · 14 comments

Comments

Projects
None yet
8 participants
@danbri
Contributor

danbri commented Dec 28, 2014

schema.rdfs.org offers JSON and CSV views of schema.org. However it is un-maintained. We are now reasonably well set up to do more of this kind of thing within schema.org itself than when both sites were first launched.

  • JSON(-LD)
  • Turtle #317
  • CSV
  • Other?
@danbri

This comment has been minimized.

Show comment
Hide comment
@danbri

danbri Dec 28, 2014

Contributor

Here's a quick look at reproducing the CSV export for types. You can run it in localhost:8000/console in appengine.

    # CSV for types:
    # id,label,comment,ancestors,supertypes,subtypes,properties
    # ComedyClub,Comedy Club,,Thing Organization LocalBusiness EntertainmentBusiness,EntertainmentBusiness,,

    import pprint
    from api import *

    t = 'CreativeWork'

    di = Unit.GetUnit("domainIncludes")
    ri = Unit.GetUnit("rangeIncludes")

    def GetLabel(term):
        for triple in term.arcsOut:
                if (triple.arc.id == 'rdfs:label'):
                    return triple.text
    def PropsForType(term):
            for prop in sorted(GetSources(di, term), key=lambda u: u.id):
                pprint.pprint("Property: %s" % prop.id )

    term = Unit.GetUnit(t)
    term_desc = GetComment(term)
    p_subtypes = GetImmediateSubtypes(term)
    p_supertypes = GetImmediateSupertypes(term)

    subs =  ( "Direct subtypes of %s: %s" % ( term.id, ', '.join([str(x.id) for x in p_subtypes]) ) )
    sups =  ( "Direct supertypes of %s: %s" % ( term.id, ', '.join([str(x.id) for x in p_supertypes]) ) )

    pprint.pprint("Term: %s Label: %s Desc: %s Subs: %s Supers: %s Properties: %s" % (term.id, GetLabel(term), term_desc, subs, sups, PropsForType(term) )  )
Contributor

danbri commented Dec 28, 2014

Here's a quick look at reproducing the CSV export for types. You can run it in localhost:8000/console in appengine.

    # CSV for types:
    # id,label,comment,ancestors,supertypes,subtypes,properties
    # ComedyClub,Comedy Club,,Thing Organization LocalBusiness EntertainmentBusiness,EntertainmentBusiness,,

    import pprint
    from api import *

    t = 'CreativeWork'

    di = Unit.GetUnit("domainIncludes")
    ri = Unit.GetUnit("rangeIncludes")

    def GetLabel(term):
        for triple in term.arcsOut:
                if (triple.arc.id == 'rdfs:label'):
                    return triple.text
    def PropsForType(term):
            for prop in sorted(GetSources(di, term), key=lambda u: u.id):
                pprint.pprint("Property: %s" % prop.id )

    term = Unit.GetUnit(t)
    term_desc = GetComment(term)
    p_subtypes = GetImmediateSubtypes(term)
    p_supertypes = GetImmediateSupertypes(term)

    subs =  ( "Direct subtypes of %s: %s" % ( term.id, ', '.join([str(x.id) for x in p_subtypes]) ) )
    sups =  ( "Direct supertypes of %s: %s" % ( term.id, ', '.join([str(x.id) for x in p_supertypes]) ) )

    pprint.pprint("Term: %s Label: %s Desc: %s Subs: %s Supers: %s Properties: %s" % (term.id, GetLabel(term), term_desc, subs, sups, PropsForType(term) )  )
@danbri

This comment has been minimized.

Show comment
Hide comment
@danbri
Contributor

danbri commented Dec 28, 2014

@sesuncedu

This comment has been minimized.

Show comment
Hide comment
@sesuncedu

sesuncedu Dec 28, 2014

Contributor

What about mapping to/from OWL? Now I have a microdata->RDF parser working, I can get back to hacking on this.
I'm not sure if it's better to use anonymous union classes where there are multiple domain and range statements given, or whether defining a named equivalent class is nicer (that has the advantage of possibly catching some missing abstractions when the hierarchy is classified ).

I'm feeling lazy enough to not bother trying to be clever about properties that are data and object valued, and just box incoming literal values.

Contributor

sesuncedu commented Dec 28, 2014

What about mapping to/from OWL? Now I have a microdata->RDF parser working, I can get back to hacking on this.
I'm not sure if it's better to use anonymous union classes where there are multiple domain and range statements given, or whether defining a named equivalent class is nicer (that has the advantage of possibly catching some missing abstractions when the hierarchy is classified ).

I'm feeling lazy enough to not bother trying to be clever about properties that are data and object valued, and just box incoming literal values.

@gebrits

This comment has been minimized.

Show comment
Hide comment
@gebrits

gebrits Dec 11, 2015

@danbri is this still on the agenda? Specifically looking for an up-to-date json-LD representation including attribute-types

gebrits commented Dec 11, 2015

@danbri is this still on the agenda? Specifically looking for an up-to-date json-LD representation including attribute-types

@danbri danbri removed the type:enhancement label Mar 7, 2016

@danbri

This comment has been minimized.

Show comment
Hide comment
@danbri

danbri May 15, 2016

Contributor

Yup, this still matters...

Contributor

danbri commented May 15, 2016

Yup, this still matters...

@3sv

This comment has been minimized.

Show comment
Hide comment
@3sv

3sv Aug 26, 2016

There is a json-ld representation at the root of schema.org that is served by content negotiation (accept header application/ld+json - explained in the wiki here: https://github.com/schemaorg/schemaorg/wiki/JsonLd)

@danbri Are there plans to allow partial requests in json-ld to schema.org, ie getting https://schema.org/Person in json-ld format?

3sv commented Aug 26, 2016

There is a json-ld representation at the root of schema.org that is served by content negotiation (accept header application/ld+json - explained in the wiki here: https://github.com/schemaorg/schemaorg/wiki/JsonLd)

@danbri Are there plans to allow partial requests in json-ld to schema.org, ie getting https://schema.org/Person in json-ld format?

@RichardWallis

This comment has been minimized.

Show comment
Hide comment
@RichardWallis

RichardWallis Aug 26, 2016

Contributor

@3sv checkout the export formats section on meta-issue (#3) to see what's on the pending list.

I'm hoping to get on to many of these soon.

Contributor

RichardWallis commented Aug 26, 2016

@3sv checkout the export formats section on meta-issue (#3) to see what's on the pending list.

I'm hoping to get on to many of these soon.

@morseltech

This comment has been minimized.

Show comment
Hide comment
@morseltech

morseltech Dec 6, 2016

@RichardWallis when you say 'export format' do you mean 'alternative representations'? I can't see the point of having https://schema.org/Person in json-ld format if the URL is not https://schema.org/Person. Each representation should use content negotiation via the HTTP Accept header right?

morseltech commented Dec 6, 2016

@RichardWallis when you say 'export format' do you mean 'alternative representations'? I can't see the point of having https://schema.org/Person in json-ld format if the URL is not https://schema.org/Person. Each representation should use content negotiation via the HTTP Accept header right?

@BigBlueHat

This comment has been minimized.

Show comment
Hide comment
@BigBlueHat

BigBlueHat Dec 6, 2016

@morseltech see the content of #1351. Specifically:

Introduced content negotiation on per-term pages for the following accept types, mapping to the associated file extension types:...

Happy to see this happening, fwiw! 😁

BigBlueHat commented Dec 6, 2016

@morseltech see the content of #1351. Specifically:

Introduced content negotiation on per-term pages for the following accept types, mapping to the associated file extension types:...

Happy to see this happening, fwiw! 😁

@morseltech

This comment has been minimized.

Show comment
Hide comment
@morseltech

morseltech Dec 6, 2016

Awesome. When are these changes expected to be release on the site?

morseltech commented Dec 6, 2016

Awesome. When are these changes expected to be release on the site?

@danbri

This comment has been minimized.

Show comment
Hide comment
@danbri

danbri Dec 6, 2016

Contributor

We're overdue for a release, I hope to finalize a release candidate this week, and to get it published this year.

Contributor

danbri commented Dec 6, 2016

We're overdue for a release, I hope to finalize a release candidate this week, and to get it published this year.

@morseltech

This comment has been minimized.

Show comment
Hide comment
@morseltech

morseltech Dec 6, 2016

Fantastic news. This provides huge benefits, not least of which is people that as scared of RDF don't need to see the underlying RDF and also that each term reference becomes an example for modelling in json-ld. Good job schema.org team. Yay!

morseltech commented Dec 6, 2016

Fantastic news. This provides huge benefits, not least of which is people that as scared of RDF don't need to see the underlying RDF and also that each term reference becomes an example for modelling in json-ld. Good job schema.org team. Yay!

@pmackay

This comment has been minimized.

Show comment
Hide comment
@pmackay

pmackay Feb 21, 2017

May I ask, when might a CSV download be available?

pmackay commented Feb 21, 2017

May I ask, when might a CSV download be available?

@danbri

This comment has been minimized.

Show comment
Hide comment
@danbri

danbri Feb 21, 2017

Contributor

Early access to CSV and related improvements: http://webschemas.org/docs/developers.html

This will be on the schema.org site in the next release.

Contributor

danbri commented Feb 21, 2017

Early access to CSV and related improvements: http://webschemas.org/docs/developers.html

This will be on the schema.org site in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment