PHPackages                             melting-server/schema-dot-org-laravel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. melting-server/schema-dot-org-laravel

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

melting-server/schema-dot-org-laravel
=====================================

Provides melting-server/schema-dot-org-tree into laravel.

00PHP

Since Nov 10Pushed 6y ago1 watchersCompare

[ Source](https://github.com/melting-server/schema-dot-org-laravel)[ Packagist](https://packagist.org/packages/melting-server/schema-dot-org-laravel)[ RSS](/packages/melting-server-schema-dot-org-laravel/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

About
=====

[](#about)

This library grabs and parses Schema.org into a structured array for Laravel 5+ which is cached according to your application's caching preferences.

 is a more friendly tool for using Schema.org within your IDE. Spatie's schema tool comes with IDE autocomplete and loads of other goodies to help you work with Schema.org.

Install
=======

[](#install)

```
composer require melting-server\schema-dot-org-laravel
```

Optional | You can publish the configuration file to tweak the caching settings.

```
php artisan vendor:publish --provider="Schema\SchemaServiceProvider"
```

Usage
=====

[](#usage)

Initialize:

```
use SchemaDotOrgTree\Tree;

$tree = app()->make(Tree::class);
```

By default, the first time the application builds the tree - it will download the jsonld from schema.org's github repository and parse it into a tree. The tree is then cached within the application (however you've setup your default Laravel caching). The whole process takes ~2seconds but its cached anyway to be nice.

The Tree
--------

[](#the-tree)

```
//For the latest schema.org (default):
$tree = new Tree();

//For "all" of the latest schemas:
$tree = new Tree('5.0-all');

//For a specific version:
$tree = new Tree('3.7-core');
```

You can now access the structured tree:

```
var_dump($tree->getTree()); //Structured tree
```

Entities
--------

[](#entities)

Get an entity:

```
$entity = $tree->getEntity("http://schema.org/Thing");
```

Entities can have a parent Entity and may have children Entities:

```
$parent = $entity->getParent(); // returns Entity or null
$children = $entity->getChildren(); // returns Entity[] (the array might be empty)
```

You can test to see if an Entity exists anywhere in the tree:

```
$tree->isLocatable("http://schema.org/Thing");
```

Entities provide these public properties (not to be confused with the Entity's Schema Properties, below):

```
// The Entity Property            The schema.org "field"
public $id;                    // from "@id"
public $type;                  // from "@type"
public $supersededBy;          // from "http://schema.org/supersededBy"
public $comment;               // from "rdfs:comment"
public $label;                 // from "rdfs:label"
public $subClassOf;            // from "rdfs:subClassOf"
public $purlSource;            // from "http://purl.org/dc/terms/source"
public $owlEquivalentProperty; // from "http://www.w3.org/2002/07/owl#equivalentClass"
public $category;              // from "http://schema.org/category"
public $closeMatch;            // from "http://www.w3.org/2004/02/skos/core#closeMatch"

/** @var string $version */
public $version;

/** @var Entity[] */
public $children = [];

/** @var Property[] */
public $properties = [];
```

Properties
----------

[](#properties)

Get an entity's properties

```
$properties = $entity->getProperties();      //with inherited properties
$properties = $entity->getProperties(false); //without inherited properties
```

Properties provide these public properties

```
// The Entity Property            The schema.org "field"
public $id;                       // from @id
public $type;                     // from @type
public $domainIncludes = [];      // from http://schema.org/domainIncludes
public $rangeIncludes = [];       // from http://schema.org/rangeIncludes
public $comment = "";             // from rdfs:comment
public $label = "";               // from rdfs:label
public $purlSource;               // from http://purl.org/dc/terms/source
public $owlEquivalentProperty;    // from http://www.w3.org/2002/07/owl#equivalentProperty
public $subPropertyOf;            // from rdfs:subPropertyOf
public $category;                 // from http://schema.org/category
public $inverseOf;                // from http://schema.org/inverseOf
public $supersededBy;             // from http://schema.org/supersededBy

/** @var string */
public $version;

/** @var bool */
public $inherited;
```

Advanced Usage
==============

[](#advanced-usage)

Most developers should probably not need these things, but you're your own person.

Reader Data
-----------

[](#reader-data)

Access the underlying json data from schema.org via

```
$tree->reader->getJson();
```

Multiple Version Support
------------------------

[](#multiple-version-support)

Specify the version you wish by using the config file which will outline an environment variable (.env) you can use.

```
SCHEMA_DOT_ORG_VERSION=3.7-all
```

You can get a list of the available versions with:

```
$tree->reader::VERSIONS
```

Currently supported versions:

- '3.1-core' =&gt; '',
- '3.1-all' =&gt; '',
- '3.2-core' =&gt; '',
- '3.2-all' =&gt; '',
- '3.3-core' =&gt; '',
- '3.3-all' =&gt; '',
- '3.4-core' =&gt; '',
- '3.4-all' =&gt; '',
- '3.5-core' =&gt; '',
- '3.5-all' =&gt; '',
- '3.6-core' =&gt; '',
- '3.6-all' =&gt; '',
- '3.7-core' =&gt; '',
- '3.7-all' =&gt; '',
- '3.8-core' =&gt; '',
- '3.8-all' =&gt; '',
- '3.9-core' =&gt; '',
- '4.0-all' =&gt; '',
- '4.0-core' =&gt; '',
- '5.0-all' =&gt; '',
- '5.0-core' =&gt; '',

You can compare versions to see what is included/excluded between versions. Most implementations should just stick with the default "latest".

```
new Tree('latest');
new Tree('4.0-core');
new Tree('3.7-core');
var_dump(Tree::$trees);

/**
Outputs: [
    'latest' => {Tree}
    '4.0-core' => {Tree}
    '3.7-core' => {Tree}
]
*/
```

With multiple trees in memory, you can retrieve specfic entities from specific versions.

```
$entity = Tree::getEntityReference('latest', 'http://schema.org/Thing');
```

Each class/property/dataType is loaded with knowledge about which version from which it was loaded.

```
$entity->version;
```

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/d0c22d634449015d05235fc2423d2bf126ecab1dee061bb51c1ca329509967cd?d=identicon)[jksteelman](/maintainers/jksteelman)

---

Top Contributors

[![jksteelman](https://avatars.githubusercontent.com/u/5976473?v=4)](https://github.com/jksteelman "jksteelman (1 commits)")

### Embed Badge

![Health badge](/badges/melting-server-schema-dot-org-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/melting-server-schema-dot-org-laravel/health.svg)](https://phpackages.com/packages/melting-server-schema-dot-org-laravel)
```

###  Alternatives

[spatie/unit-conversions

Perform unit conversions in PHP

363.5k](/packages/spatie-unit-conversions)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
