Coder Social home page Coder Social logo

superuserdev / schemaserver Goto Github PK

View Code? Open in Web Editor NEW
6.0 1.0 2.0 265 KB

A microdata-based API server written in PHP using PostgreSQL

License: GNU Lesser General Public License v3.0

PHP 90.21% SQLPL 9.79%
php postgresql api api-server json schema-org microdata json-ld

schemaserver's People

Contributors

gitter-badger avatar shgysk8zer0 avatar waffle-iron avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

schemaserver's Issues

Change namespaces, etc. to organization

The project is being transferred to organization account. This means that all namespaces will need to be changed from shgysk8zer0\SchemaServer to SuperUserDev\SchemaServer.

A simple find-and-replace should work.

Changing owners shouldn't affect any working / checked-out code. It will only be an issue if namespace does not match cloned directory.

Parse json & *[] from PostrgreSQL

Need to be able to correctly parse and create

  • {"str1", "str2", ...} text[]
  • {'{"key": "value"}, ...'} jsonb[]
  • {"key": "value", ...} jsonb

Will need to create a method to distinguish between types text, text[], jsonb, & jsonb[]

Add docs

Need the typical:

  • CONTRIBUTING
  • ISSUE_TEMPLATE
  • PULL_REQUEST_TEMPLATE

Add validation for non-http URLS

Should have URLs valid for geo:, mailto:, bitcoin:, tel:

Will probably involve stripping off the protocol and validating the data. Perhaps PHP's URL parsing functions can assist here.

Finish creating common classes

Still need:

  • Event
  • Article
  • Comment
  • Review
  • AggregateRating
  • Action
  • Full implementation of Thing
  • AudioObject
  • VideoObject
  • Book
  • Mesage
  • WebPage
  • WebPageElement/*
  • Language
  • Service
  • GeoShape
  • OpeningHoursSpecification
  • PriceSpecification
  • Product
  • Store
  • Question
  • Answer
  • Database structure dump with new tables for each

Anything else necessary for inheritance and critical properties of the above.

Properties with multiple values

This is one of those questions that needs a VERY solid answer. How can I, for example, set multiple values for image for a Person? Performance will be heavily impacted by the solution to this problem.

Need to be able to reference several Things and be able to to construct them from whatever is stored in this field.

Lint PHP files

Implement at least some basic linting of PHP scripts for Travis-CI

Finish implementing CreativeWork

Please provide a link to the type on schema.org

CreativeWork

If you would like a new property or type defined, please first have it added
to schema.org

If you are reporting an error, do you have any debugging info info/log output?

In some detail, please describe your issue

Many properties are missing. Since this class is the base/parent for Article, ImageObject, and many others, full implementation is a high priority.

Should Geometry helper class be created?

GeoShape can be a line, circle, rectangle, or polygon. Each of these takes in at least one GPS coordinates (longitude, latitude).

Should I include a helper class/trait/interface that adds points (GeoCoordinates) to a given shape and generates the correct shape?

public static function makePolygon(GeoCoordinates ...$coords): String;

public static function makeCircle(GeoCoordinates $origin, Float $radius): String;

public static function makeBox(GeoCoordinates $pt1, GeoCoordinates $pt2): String;

public static function makeLine(GeoCoordinates $pt1, GeoCoordinates $pt2): String;

Improve linting

  • Check to make sure that all files are named correctly for their classes using class_exists
  • Move all testing scripts to .test/directory
  • Check that database table exists for each class (probably cannot check case easily)

Save simple measurements?

Should things like Distance be stored with their own table? I don't see that an object for 5 feet would benefit from having an image for that distance, nor that it would make sense to share that value with all other things that are 5 feet.

Perhaps this would make more sense to store as simple jsonb. It would even end up saving some sub-queries if, for example, querying for an extension cord that is 5' long.

On the other hand, reuse would end up saving space and would make classes, tables, & schemas consistent.

Implement saving objects/things

Using a trait, implement method saving days too database.

For future simplicity, the SQL should be generated by PHP, allowing any class/object to just call this method to save itself.

Should return a hash it id.

Allow setting multiple values to a property

Using the _set method only allows for setting a single value. Need to create an _add method that will append values to an array (or SplObjectStorage).

Will then need to add appropriate methods such as Thing::addImage() and update database structure to allow jsonb[] storage.

Missing tables in database

There are 64 tables created in db.sql, but 66 classes.
Really need a way of checking that all classes & tables exist. Which would be easier if the only PHP scripts in root directory were classes.

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.