GithubHelp home page GithubHelp logo

qpc-github / profilegenerator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bioschemas/profilegenerator

1.0 2.0 0.0 159 KB

Experimental scripts for creating a new Bioschemas Profile

License: MIT License

Python 100.00%

profilegenerator's Introduction

Bioschemas ProfileGenerator

Experimental scripts for creating a new Bioschemas Profile

Installation

If you have Conda/BioConda the below should hopefully work:

    git clone https://github.com/BioSchemas/ProfileGenerator
    cd ProfileGenerator
    conda env create
    conda activate profilegenerator
    type python  ## /home/stain/miniconda3/envs/profilegenerator/bin/python
    python setup.py install

Usage

conda activate profilegenerator
python setup.py install  # reinstall on code update
bioschemas-profilegen -v
bioschemas-profilegen -h
bioschemas-profilegen Dataset FancyDataset

If you don't have Conda, or use virtualenv or similar, then setup.py lists the Python dependencies. This code has been tested with Python 3.8.

Schema.org examples

You can show auto-generated examples for a particular schema.org property:

(profilegenerator) stain@biggie:~/src/ProfileGenerator$ schemaorg-example attendee
{ "@context": "https://schema.org/",
  "@id": "https://example.com/event/123",
  "@type": "Event",
  "attendee": {"@id": "https://example.com/organization/345", "@type": "Organization"}
}
{ "@context": "https://schema.org/",
  "@id": "https://example.com/event/123",
  "@type": "Event",
  "attendee": {"@id": "https://orcid.org/0000-0002-1825-0097", "@type": "Person"}
}

The above shows one example for each each potential @type in the range of the property.

It is possible to generate a complete (but perhaps overwhelming) example of a given schema.org type. In this case only one potential @type is rendered per property:

(profilegenerator) stain@biggie:~/src/ProfileGenerator$ schemaorg-example Event
{ "@context": "https://schema.org/",
  "@id": "https://example.com/event/123",
  "@type": "Event",
  "about": {"@id": "https://example.com/thing/345", "@type": "Thing"},
  "actor": {"@id": "https://orcid.org/0000-0002-1825-0097", "@type": "Person"},
  "aggregateRating": {"@type": "AggregateRating"},
  "attendee": {"@id": "https://orcid.org/0000-0002-1825-0097", "@type": "Person"},
  "attendees": {"@id": "https://orcid.org/0000-0002-1825-0097", "@type": "Person"},
  "audience": {"@type": "Audience"},
  "composer": {"@id": "https://orcid.org/0000-0002-1825-0097", "@type": "Person"},
  "contributor": {"@id": "https://orcid.org/0000-0002-1825-0097", "@type": "Person"},
  "director": {"@id": "https://orcid.org/0000-0002-1825-0097", "@type": "Person"},
  "doorTime": "2020-10-08T17:33:08+01:00",
  "duration": {"@type": "Duration"},
  "endDate": "2020-10-08",
  "eventAttendanceMode": {"@type": "EventAttendanceModeEnumeration"},
  "eventSchedule": {"@type": "Schedule"},
  "eventStatus": {"@type": "EventStatusType"},
  "funder": {"@id": "https://example.com/organization/345", "@type": "Organization"},
  "inLanguage": "example inlanguage",
  "isAccessibleForFree": false,
  "location": {"@id": "https://example.com/place/345", "@type": "Place"},
  "maximumAttendeeCapacity": 123,
  "maximumPhysicalAttendeeCapacity": 123,
  "maximumVirtualAttendeeCapacity": 123,
  "offers": {"@type": "Offer"},
  "organizer": {"@id": "https://example.com/organization/345", "@type": "Organization"},
  "performer": {"@id": "https://orcid.org/0000-0002-1825-0097", "@type": "Person"},
  "performers": {"@id": "https://example.com/organization/345", "@type": "Organization"},
  "previousStartDate": "2020-10-08",
  "recordedIn": {"@id": "https://example.com/creativework/345", "@type": "CreativeWork"},
  "remainingAttendeeCapacity": 123,
  "review": {"@id": "https://example.com/review/345", "@type": "Review"},
  "sponsor": {"@id": "https://orcid.org/0000-0002-1825-0097", "@type": "Person"},
  "startDate": "2020-10-08T17:33:08+01:00",
  "subEvent": {"@id": "https://example.com/event/345", "@type": "Event"},
  "subEvents": {"@id": "https://example.com/event/345", "@type": "Event"},
  "superEvent": {"@id": "https://example.com/event/345", "@type": "Event"},
  "translator": {"@id": "https://orcid.org/0000-0002-1825-0097", "@type": "Person"},
  "typicalAgeRange": "example typicalagerange",
  "workFeatured": {"@id": "https://example.com/creativework/345", "@type": "CreativeWork"},
  "workPerformed": {"@id": "https://example.com/creativework/345", "@type": "CreativeWork"},
  "additionalType": "https://purl.example.org/additionaltype-345",
  "alternateName": "example alternatename",
  "description": "example description",
  "disambiguatingDescription": "example disambiguatingdescription",
  "identifier": "https://purl.example.org/identifier-345",
  "image": "https://purl.example.org/image-345",
  "mainEntityOfPage": "https://purl.example.org/mainentityofpage-345",
  "name": "example name",
  "potentialAction": {"@id": "https://example.com/action/345", "@type": "Action"},
  "sameAs": "https://purl.example.org/sameas-345",
  "subjectOf": {"@id": "https://example.com/creativework/345", "@type": "CreativeWork"},
  "url": "https://purl.example.org/url-345"
}

License

MIT License https://spdx.org/licenses/MIT

Copyright (c) 2020 Heriot-Watt University, UK
Copyright (c) 2020 The University of Manchester, UK

See LICENSE for details.

profilegenerator's People

Contributors

stain avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.