Oihana PHP System

DublinCore implements JsonSerializable uses ThingTrait, DublinCoreTrait, DublinCore

The DCMI Metadata Terms.

Tags
see
https://www.dublincore.org/specifications/dublin-core/dcmi-terms/

Table of Contents

Interfaces

JsonSerializable

Constants

ABSTRACT  = 'abstract'
ACCESS_RIGHT  = 'accessRight'
ACCRUAL_METHOD  = 'accrualMethod'
ACCRUAL_PERIODICITY_MORE  = 'accrualPeriodicityMore'
ACCRUAL_POLICY  = 'accrualPolicy'
ALTERNATIVE  = 'alternative'
AVAILABLE  = 'available'
BIBLIOGRAPHIC_CITATION  = 'bibliographicCitation'
CONFORMS_TO  = 'conformsTo'
CONTEXT  = 'http://purl.org/dc'
JSON-LD @context declaration for Schema.org.
CONTRIBUTOR  = 'contributor'
COVERAGE  = 'coverage'
CREATED  = 'created'
CREATOR  = 'creator'
DATE  = 'date'
DATE_ACCEPTED  = 'dateAccepted'
DATE_COPYRIGHTED  = 'dateCopyrighted'
DATE_SUBMITTED  = 'dateSubmitted'
DESCRIPTION  = 'description'
EDUCATION_LEVEL  = 'educationLevel'
EXTENT  = 'extent'
FORMAT  = 'format'
HAS_FORMAT  = 'hasFormat'
HAS_VERSION  = 'hasVersion'
IDENTIFIER  = 'identifier'
INSTRUCTIONAL_METHOD_MORE  = 'instructionalMethodMore'
IS_FORMAT_OF  = 'isFormatOf'
IS_PART_OF  = 'isPartOf'
IS_REFERENCED_BY  = 'isReferencedBy'
IS_REPLACED_BY  = 'isReplacedBy'
IS_REQUIRED_BY  = 'isRequiredBy'
IS_VERSION_OF  = 'isVersionOf'
ISSUED  = 'issued'
JSON_PRIORITY_KEYS  = [\org\schema\constants\Schema::AT_TYPE, \org\schema\constants\Schema::AT_CONTEXT, \org\schema\constants\Schema::_KEY, \org\schema\constants\Schema::_FROM, \org\schema\constants\Schema::_TO, \org\schema\constants\Schema::ID, \org\schema\constants\Schema::NAME, \org\schema\constants\Schema::URL, \org\schema\constants\Schema::CREATED, \org\schema\constants\Schema::MODIFIED]
Defines the priority order of keys when serializing the object to JSON-LD.
LANGUAGE  = 'language'
LICENSE  = 'license'
MEDIATOR  = 'mediator'
MEDIUM  = 'medium'
MODIFIED  = 'modified'
PROVENANCE  = 'provenance'
PUBLISHER  = 'publisher'
REFERENCES  = 'references'
RELATION  = 'relation'
REPLACES  = 'replaces'
REQUIRES  = 'requires'
RIGHTS  = 'rights'
RIGHTS_HOLDER  = 'rightsHolder'
SOURCE  = 'source'
SPATIAL  = 'spatial'
SUBJECT  = 'subject'
TABLE_OF_CONTENTS  = 'tableOfContents'
TEMPORAL  = 'temporal'
TITLE  = 'title'
TYPE  = 'type'
VALID  = 'valid'

Properties

$abstract  : string|null
A summary of the resource.
$accessRight  : string|null
Information about who access the resource or an indication of its security status.
$accrualMethod  : string|null
The method by which items are added to a collection.
$accrualPeriodicityMore  : string|null
The frequency with which items are added to a collection.
$accrualPolicy  : string|null
The policy governing the addition of items to a collection.
$alternative  : string|null
An alternative name for the resource.
$available  : string|null
Date that the resource became or will become available.
$bibliographicCitation  : string|null
A bibliographic reference for the resource.
$conformsTo  : string|null
An established standard to which the described resource conforms.
$contributor  : string|null
An entity responsible for making contributions to the resource.
$coverage  : string|null
The spatial or temporal topic of the resource, spatial applicability of the resource, or jurisdiction under which the resource is relevant.
$created  : string|null
Date of creation of the resource.
$creator  : string|object|array<string|int, mixed>|null
An entity responsible for making the resource.
$date  : string|null
A point or period of time associated with an event in the lifecycle of the resource.
$dateAccepted  : string|null
Date of acceptance of the resource.
$dateCopyrighted  : string|null
Date of copyright of the resource.
$dateSubmitted  : string|null
Date of submission of the resource.
$description  : string|null
An account of the resource.
$educationLevel  : string|null
Audience Education Level
$extent  : string|null
The size or duration of the resource.
$format  : string|null
The file format, physical medium, or dimensions of the resource.
$hasFormat  : string|array<string|int, mixed>|object|null
Has Format
$hasVersion  : string|array<string|int, mixed>|object|null
A related resource that is a version, edition, or adaptation of the described resource.
$identifier  : string|null
An unambiguous reference to the resource within a given context.
$instructionalMethodMore  : string|object|null
A process, used to engender knowledge, attitudes and skills, that the described resource is designed to support.
$isFormatOf  : string|object|null
A pre-existing related resource that is substantially the same as the described resource, but in another format.
$isPartOf  : string|object|null
A related resource in which the described resource is physically or logically included.
$isReferencedBy  : string|object|null
A related resource that references, cites, or otherwise points to the described resource.
$isReplacedBy  : string|object|null
A related resource that supplants, displaces, or supersedes the described resource.
$isRequiredBy  : string|object|array<string|int, mixed>|null
A related resource that requires the described resource to support its function, delivery, or coherence.
$issued  : string|null
Date of formal issuance of the resource.
$isVersionOf  : string|object|null
A related resource of which the described resource is a version, edition, or adaptation.
$language  : string|array<string|int, mixed>|object|null
A language of the resource.
$license  : string|null
A legal document giving official permission to do something with the resource.
$mediator  : string|object|array<string|int, mixed>|null
An entity that mediates access to the resource.
$medium  : string|object|array<string|int, mixed>|null
The material or physical carrier of the resource.
$modified  : string|null
Date on which the resource was changed.
$provenance  : string|array<string|int, mixed>|object|null
A statement of any changes in ownership and custody of the resource since its creation that are significant for its authenticity, integrity, and interpretation.
$publisher  : string|object|array<string|int, mixed>|null
An entity responsible for making the resource available.
$references  : string|object|array<string|int, mixed>|null
A related resource that is referenced, cited, or otherwise pointed to by the described resource.
$relation  : string|object|array<string|int, mixed>|null
A related resource.
$replaces  : string|object|array<string|int, mixed>|null
A related resource that is supplanted, displaced, or superseded by the described resource.
$requires  : string|object|array<string|int, mixed>|null
A related resource that is required by the described resource to support its function, delivery, or coherence.
$rights  : string|object|array<string|int, mixed>|null
Information about rights held in and over the resource.
$rightsHolder  : string|object|array<string|int, mixed>|null
A person or organization owning or managing rights over the resource.
$source  : string|object|array<string|int, mixed>|null
A related resource from which the described resource is derived.
$spatial  : string|object|array<string|int, mixed>|null
Spatial characteristics of the resource.
$subject  : string|object|array<string|int, mixed>|null
A topic of the resource.
$tableOfContents  : string|array<string|int, mixed>|object|null
A list of subunits of the resource.
$temporal  : string|array<string|int, mixed>|object|null
Temporal characteristics of the resource.
$title  : string|object|array<string|int, mixed>|null
The title of the ressource.
$type  : string|object|null
The nature or genre of the resource.
$valid  : string|null
Date (often a range) of validity of a resource.
$atContext  : string|null
The JSON-LD `@context` value.
$atType  : string|null
The JSON-LD `@type` value.

Methods

__construct()  : mixed
Constructor to hydrate public properties from an array or stdClass.
jsonSerialize()  : array<string|int, mixed>
Serializes the current object into a JSON-LD array.
withAtContext()  : $this
Sets the internal JSON-LD `@context` attribute.
withAtType()  : $this
Sets the internal JSON-LD `@type` attribute.
withJSONLDMeta()  : $this
Initializes both JSON-LD metadata: `@type` and `@context`.

Constants

ACCESS_RIGHT

public mixed ACCESS_RIGHT = 'accessRight'

ACCRUAL_METHOD

public mixed ACCRUAL_METHOD = 'accrualMethod'

ACCRUAL_PERIODICITY_MORE

public mixed ACCRUAL_PERIODICITY_MORE = 'accrualPeriodicityMore'

ACCRUAL_POLICY

public mixed ACCRUAL_POLICY = 'accrualPolicy'

ALTERNATIVE

public mixed ALTERNATIVE = 'alternative'

BIBLIOGRAPHIC_CITATION

public mixed BIBLIOGRAPHIC_CITATION = 'bibliographicCitation'

CONFORMS_TO

public mixed CONFORMS_TO = 'conformsTo'

CONTEXT

JSON-LD @context declaration for Schema.org.

public mixed CONTEXT = 'http://purl.org/dc'

CONTRIBUTOR

public mixed CONTRIBUTOR = 'contributor'

DATE_ACCEPTED

public mixed DATE_ACCEPTED = 'dateAccepted'

DATE_COPYRIGHTED

public mixed DATE_COPYRIGHTED = 'dateCopyrighted'

DATE_SUBMITTED

public mixed DATE_SUBMITTED = 'dateSubmitted'

DESCRIPTION

public mixed DESCRIPTION = 'description'

EDUCATION_LEVEL

public mixed EDUCATION_LEVEL = 'educationLevel'

HAS_FORMAT

public mixed HAS_FORMAT = 'hasFormat'

HAS_VERSION

public mixed HAS_VERSION = 'hasVersion'

IDENTIFIER

public mixed IDENTIFIER = 'identifier'

INSTRUCTIONAL_METHOD_MORE

public mixed INSTRUCTIONAL_METHOD_MORE = 'instructionalMethodMore'

IS_FORMAT_OF

public mixed IS_FORMAT_OF = 'isFormatOf'

IS_REFERENCED_BY

public mixed IS_REFERENCED_BY = 'isReferencedBy'

IS_REPLACED_BY

public mixed IS_REPLACED_BY = 'isReplacedBy'

IS_REQUIRED_BY

public mixed IS_REQUIRED_BY = 'isRequiredBy'

IS_VERSION_OF

public mixed IS_VERSION_OF = 'isVersionOf'

JSON_PRIORITY_KEYS

Defines the priority order of keys when serializing the object to JSON-LD.

public array<string|int, string> JSON_PRIORITY_KEYS = [\org\schema\constants\Schema::AT_TYPE, \org\schema\constants\Schema::AT_CONTEXT, \org\schema\constants\Schema::_KEY, \org\schema\constants\Schema::_FROM, \org\schema\constants\Schema::_TO, \org\schema\constants\Schema::ID, \org\schema\constants\Schema::NAME, \org\schema\constants\Schema::URL, \org\schema\constants\Schema::CREATED, \org\schema\constants\Schema::MODIFIED]

Keys listed here will always appear first in the serialized array, in the order specified. All remaining public properties will be sorted alphabetically after these priority keys.

This ensures that important JSON-LD metadata and system fields (like @type, @context, _key, id, url, created, modified, etc.) appear at the top of the output for consistency and readability.

Usage:

$orderedKeys = self::JSON_PRIORITY_KEYS;

Notes:

  • Can be overridden in a subclass by redefining the constant.
  • Late static binding (static::JSON_PRIORITY_KEYS) allows child classes to modify the serialization order.

List of JSON-LD keys in priority order.

PROVENANCE

public mixed PROVENANCE = 'provenance'

REFERENCES

public mixed REFERENCES = 'references'

RIGHTS_HOLDER

public mixed RIGHTS_HOLDER = 'rightsHolder'

TABLE_OF_CONTENTS

public mixed TABLE_OF_CONTENTS = 'tableOfContents'

Properties

$accessRight

Information about who access the resource or an indication of its security status.

public string|null $accessRight

$accrualMethod

The method by which items are added to a collection.

public string|null $accrualMethod

$accrualPeriodicityMore

The frequency with which items are added to a collection.

public string|null $accrualPeriodicityMore

$accrualPolicy

The policy governing the addition of items to a collection.

public string|null $accrualPolicy

$alternative

An alternative name for the resource.

public string|null $alternative

$available

Date that the resource became or will become available.

public string|null $available

$bibliographicCitation

A bibliographic reference for the resource.

public string|null $bibliographicCitation

$conformsTo

An established standard to which the described resource conforms.

public string|null $conformsTo

$contributor

An entity responsible for making contributions to the resource.

public string|null $contributor

$coverage

The spatial or temporal topic of the resource, spatial applicability of the resource, or jurisdiction under which the resource is relevant.

public string|null $coverage

$created

Date of creation of the resource.

public string|null $created

Recommended practice is to describe the date, date/time, or period of time as recommended for the property Date, of which this is a subproperty.

$creator

An entity responsible for making the resource.

public string|object|array<string|int, mixed>|null $creator

$date

A point or period of time associated with an event in the lifecycle of the resource.

public string|null $date

$dateAccepted

Date of acceptance of the resource.

public string|null $dateAccepted

$dateCopyrighted

Date of copyright of the resource.

public string|null $dateCopyrighted

$dateSubmitted

Date of submission of the resource.

public string|null $dateSubmitted

$description

An account of the resource.

public string|null $description

$educationLevel

Audience Education Level

public string|null $educationLevel

$extent

The size or duration of the resource.

public string|null $extent

Recommended practice is to specify the file size in megabytes and duration in ISO 8601 format

$format

The file format, physical medium, or dimensions of the resource.

public string|null $format

$hasFormat

Has Format

public string|array<string|int, mixed>|object|null $hasFormat

$hasVersion

A related resource that is a version, edition, or adaptation of the described resource.

public string|array<string|int, mixed>|object|null $hasVersion

$identifier

An unambiguous reference to the resource within a given context.

public string|null $identifier

$instructionalMethodMore

A process, used to engender knowledge, attitudes and skills, that the described resource is designed to support.

public string|object|null $instructionalMethodMore

$isFormatOf

A pre-existing related resource that is substantially the same as the described resource, but in another format.

public string|object|null $isFormatOf

$isPartOf

A related resource in which the described resource is physically or logically included.

public string|object|null $isPartOf

$isReferencedBy

A related resource that references, cites, or otherwise points to the described resource.

public string|object|null $isReferencedBy

$isReplacedBy

A related resource that supplants, displaces, or supersedes the described resource.

public string|object|null $isReplacedBy

$isRequiredBy

A related resource that requires the described resource to support its function, delivery, or coherence.

public string|object|array<string|int, mixed>|null $isRequiredBy

$issued

Date of formal issuance of the resource.

public string|null $issued

Recommended practice is to describe the date, date/time, or period of time as recommended for the property Date, of which this is a subproperty.

$isVersionOf

A related resource of which the described resource is a version, edition, or adaptation.

public string|object|null $isVersionOf

$language

A language of the resource.

public string|array<string|int, mixed>|object|null $language

$license

A legal document giving official permission to do something with the resource.

public string|null $license

$mediator

An entity that mediates access to the resource.

public string|object|array<string|int, mixed>|null $mediator

$medium

The material or physical carrier of the resource.

public string|object|array<string|int, mixed>|null $medium

$modified

Date on which the resource was changed.

public string|null $modified

Recommended practice is to describe the date, date/time, or period of time as recommended for the property Date, of which this is a subproperty.

$provenance

A statement of any changes in ownership and custody of the resource since its creation that are significant for its authenticity, integrity, and interpretation.

public string|array<string|int, mixed>|object|null $provenance

$publisher

An entity responsible for making the resource available.

public string|object|array<string|int, mixed>|null $publisher

$references

A related resource that is referenced, cited, or otherwise pointed to by the described resource.

public string|object|array<string|int, mixed>|null $references

This property is intended to be used with non-literal values. This property is an inverse property of Is Referenced By.

$relation

A related resource.

public string|object|array<string|int, mixed>|null $relation

This property is intended to be used with non-literal values. This property is an inverse property of Is Replaced By.

$replaces

A related resource that is supplanted, displaced, or superseded by the described resource.

public string|object|array<string|int, mixed>|null $replaces

Recommended practice is to identify the related resource by means of a URI. If this is not possible or feasible, a string conforming to a formal identification system may be provided.

$requires

A related resource that is required by the described resource to support its function, delivery, or coherence.

public string|object|array<string|int, mixed>|null $requires

This property is intended to be used with non-literal values. This property is an inverse property of Is Required By.

$rights

Information about rights held in and over the resource.

public string|object|array<string|int, mixed>|null $rights

$rightsHolder

A person or organization owning or managing rights over the resource.

public string|object|array<string|int, mixed>|null $rightsHolder

$source

A related resource from which the described resource is derived.

public string|object|array<string|int, mixed>|null $source

$spatial

Spatial characteristics of the resource.

public string|object|array<string|int, mixed>|null $spatial

$subject

A topic of the resource.

public string|object|array<string|int, mixed>|null $subject

Recommended practice is to refer to the subject with a URI. If this is not possible or feasible, a literal value that identifies the subject may be provided.

Both should preferably refer to a subject in a controlled vocabulary.

$tableOfContents

A list of subunits of the resource.

public string|array<string|int, mixed>|object|null $tableOfContents

$temporal

Temporal characteristics of the resource.

public string|array<string|int, mixed>|object|null $temporal

$title

The title of the ressource.

public string|object|array<string|int, mixed>|null $title

$type

The nature or genre of the resource.

public string|object|null $type

$valid

Date (often a range) of validity of a resource.

public string|null $valid

Recommended practice is to describe the date, date/time, or period of time as recommended for the property Date, of which this is a subproperty.

$atContext

The JSON-LD `@context` value.

private string|null $atContext = null

Default is https://schema.org.

$atType

The JSON-LD `@type` value.

private string|null $atType = null

This can be manually set or automatically inferred from the class name.

Methods

__construct()

Constructor to hydrate public properties from an array or stdClass.

public __construct([array<string|int, mixed>|object|null $init = null ]) : mixed

This allows objects to be quickly populated with associative data without manually setting each property.

Parameters
$init : array<string|int, mixed>|object|null = null

A data array or object used to initialize the instance. Keys must match public property names.

Tags
throws
ReflectionException
example
use org\schema\Person;
use org\schema\constants\Prop;

$person = new Person
([
    Prop::NAME => 'Jane Doe',
    Prop::URL  => 'https://example.com/janedoe'
]);

echo $person->name; // Outputs: Jane Doe

jsonSerialize()

Serializes the current object into a JSON-LD array.

public jsonSerialize() : array<string|int, mixed>

Includes public properties, the JSON-LD @context and @type. Null values are automatically removed.

Tags
throws
ReflectionException

If reflection fails when accessing properties.

example
use org\schema\Person;
use org\schema\constants\Prop;

$person = new Person
([
    Prop::NAME => 'John Smith',
    Prop::ID   => 'jsmith-001'
]);

echo json_encode($person, JSON_PRETTY_PRINT);

Output:

{
   "@type": "Person",
   "@context": "https://schema.org",
   "id": "jsmith-001",
   "name": "John Smith"
}
Return values
array<string|int, mixed>

JSON-LD representation of the object.

withAtContext()

Sets the internal JSON-LD `@context` attribute.

public withAtContext(string $context) : $this

Useful if you need a custom JSON-LD context.

Parameters
$context : string

Optional JSON-LD context.

Return values
$this

withAtType()

Sets the internal JSON-LD `@type` attribute.

public withAtType(string $type) : $this

Allows overriding the default type inferred from the class.

Parameters
$type : string

Optional JSON-LD type

Return values
$this

withJSONLDMeta()

Initializes both JSON-LD metadata: `@type` and `@context`.

public withJSONLDMeta([string|null $atType = null ][, string|null $atContext = null ]) : $this

Can be called from constructor or later to override default values.

Parameters
$atType : string|null = null

Optional JSON-LD type

$atContext : string|null = null

Optional JSON-LD context

Return values
$this

        
On this page

Search results