fnash/hydra-doc-parser

Hydra API 文档解析器

0.1 2018-11-09 11:14 UTC

This package is auto-updated.

Last update: 2024-09-25 06:42:01 UTC


README

解析 Hydra 文档以提取资源和可读字段。检测给定的字段是标量,还是指向一个或多个资源的链接(jsonld IRI)。

安装

$ composer require fnash/hydra-doc-parser dev-master

使用

require_once 'vendor/autoload.php';

$doc = \Fnash\HydraDoc\HydraDoc::fromUrl('https://demo.api-platform.com/docs.jsonld');

echo $doc->pretty();
- #ConstraintViolation
--- message: xmls:string
--- propertyPath: xmls:string
- #ConstraintViolationList
--- violations: #ConstraintViolation
- #Entrypoint
- #Parchment
--- description: xmls:string
--- title: xmls:string
- http://schema.org/Book
--- author: xmls:string
--- description: xmls:string
--- isbn: xmls:string
--- publicationDate: xmls:dateTime
--- reviews: http://schema.org/Review
--- title: xmls:string
- http://schema.org/Review
--- author: xmls:string
--- body: xmls:string
--- book: http://schema.org/Book
--- letter: xmls:string
--- publicationDate: xmls:dateTime
--- rating: xmls:integer