PHPackages                             lengthofrope/create-jsonld - 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. [API Development](/categories/api)
4. /
5. lengthofrope/create-jsonld

ActiveLibrary[API Development](/categories/api)

lengthofrope/create-jsonld
==========================

Simple PHP library to create JSON-LD output.

2.0.0(1y ago)3170MITPHPPHP &gt;=8.1

Since Feb 3Pushed 1y ago1 watchersCompare

[ Source](https://github.com/lengthofrope/create-jsonld)[ Packagist](https://packagist.org/packages/lengthofrope/create-jsonld)[ Docs](https://github.com/lengthofrope/create-jsonld)[ RSS](/packages/lengthofrope-create-jsonld/feed)WikiDiscussions main Synced 4w ago

READMEChangelogDependencies (1)Versions (16)Used By (0)

create-jsonld
=============

[](#create-jsonld)

Simple PHP library to create JSON-LD output.

Usage:

```
use \LengthOfRope\JSONLD;
use \LengthOfRope\JSONLD\DataType;
use \LengthOfRope\JSONLD\Schema;

$Create = JSONLD\Create::factory()->add(
    Schema\Person::factory()
        ->setId("https://www.lengthofrope.nl/authors/#john-doe")
        ->setName(
            DataType\Text::factory()
                ->setValue("John Doe")
        )
        ->setEmail("john.doe@example.com")
)->add(
    Schema\Book::factory()
        ->setAuthor(
            Schema\Person::factory()
                ->setName("John Doe")
                ->setEmail("john.doe@example.com")
        )
        ->setAbout("PHP")
        ->setName("Superb PHP Book")
        ->setAlternateName("Book one of three")
)->add(
    Schema\Book::factory()
        ->setAuthor(
            Schema\Person::factory()
                ->setId("https://www.lengthofrope.nl/authors/#john-doe")
        )
        ->setAbout("PHP")
        ->setName("Superb PHP Book with a linked author")
        ->setAlternateName("Book two of three")
)->add(
    Schema\Book::factory()
        ->setAuthor(
            Schema\Person::factory()
                ->setId("https://www.lengthofrope.nl/authors/#john-doe")
        )
        ->setAbout("PHP")
        ->setName("A less known but still superb PHP Book with a linked author")
        ->setAlternateName("Book three of three")
)->add(
    Schema\Organization::factory()
        ->setAddress(
            Schema\PostalAddress::factory()
                ->setPostalCode("1234 AA")
                ->setStreetAddress("Somewhere 12")
                ->setAddressCountry("NL")
                ->setAddressLocality("Amersfoort")
                ->setEmail("email@example.com")
                ->setTelephone("033-1234567")
                ->setAddressRegion("Utrecht")
        )
        ->setName("Devver Company")
        ->setDescription("Just another developer")
);

// Validate
if ($Create->validate()) {
    echo $Create->getJSONLDScript();
}

// Or try catch
try {
    echo $Create->getJSONLDScript();
} catch(TypeError $e) {
    echo $e->getMessage();
}
```

Version history
---------------

[](#version-history)

2.0.0

- Regenarated all classes
    - Added loads of new functionality
    - Also removed some according to the latest schema.org

1.1.3

- Fix datatype docblock issues

1.1.2

- Fix missing dataypes
- Allow adding nested Create objects to simulate arrays and keep validation working
- Add additional validation checks for new datatypes

1.1.1

- Add typehinting
- Add support for retuning arrays with objects

1.1.0

- Add basic validation for the introduced DataTypes
- Updated the example
- Remove obsolete development dependencies

1.0.2

- Add support for linking with the @id property
- Updated the example in readme.md

1.0.1

- Restructured comments
- Added @see with link to schema.org

1.0.0

- Removed Schema word from all classes **breaking change!**
- Added underscores to classes that have a reserved name or start with a number

0.9.X

- Initial development versions

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance46

Moderate activity, may be stable

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity80

Battle-tested with a long release history

 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.

###  Release Activity

Cadence

Every ~282 days

Recently: every ~39 days

Total

13

Last Release

413d ago

Major Versions

0.9.4 → 1.0.02024-12-04

1.1.3 → 2.0.02025-05-13

PHP version history (2 changes)0.9.0PHP &gt;=5.3

0.9.4PHP &gt;=8.1

### Community

Maintainers

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

---

Top Contributors

[![lengthofrope](https://avatars.githubusercontent.com/u/432399?v=4)](https://github.com/lengthofrope "lengthofrope (83 commits)")

---

Tags

JSON-LDjsonld

### Embed Badge

![Health badge](/badges/lengthofrope-create-jsonld/health.svg)

```
[![Health](https://phpackages.com/badges/lengthofrope-create-jsonld/health.svg)](https://phpackages.com/packages/lengthofrope-create-jsonld)
```

###  Alternatives

[ml/json-ld

JSON-LD Processor for PHP

3376.9M40](/packages/ml-json-ld)[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[digitalbazaar/json-ld

A JSON-LD Processor and API implementation in PHP.

28658.1k1](/packages/digitalbazaar-json-ld)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172437.8k11](/packages/pocketmine-bedrock-protocol)[simialbi/yii2-schema-org

Schema.org yii2 representation and helpers for json-ld generation in Yii framework

18105.2k4](/packages/simialbi-yii2-schema-org)

PHPackages © 2026

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