Skip to content
This repository has been archived by the owner on Aug 25, 2022. It is now read-only.

Commit

Permalink
Add the rdf_entity_graph config entity.
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiu-cristea committed Jan 9, 2018
1 parent 05be3d9 commit a946220
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 1 deletion.
5 changes: 5 additions & 0 deletions config/install/rdf_entity.graph.default.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
langcode: en
status: true
id: default
name: Default
description: 'Default graph. This is available for all entity types and bundles.'
11 changes: 10 additions & 1 deletion config/schema/rdf_entity.schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,15 @@ rdf_entity.mapping.*:
type: config_entity
label: 'Stores the mapping between Drupal bundle settings and RDF representation'
mapping:
id:
type: string
label: ID
entity_type_id:
type: string
label: 'Referred entity type'
bundle:
type: string
label: 'Referred bundle'
rdf_type:
type: string
label: 'RDF type mapping'
Expand All @@ -84,7 +93,7 @@ rdf_entity.mapping.*:
label: 'The mapping of a graph definition to a graph URI.'
base_fields_mapping:
type: sequence
label: 'Property'
label: 'The base fields mapping'
sequence:
type: sequence
label: 'Column'
Expand Down
59 changes: 59 additions & 0 deletions src/Entity/RdfEntityGraph.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?php

namespace Drupal\rdf_entity\Entity;

use Drupal\Core\Config\Entity\ConfigEntityBase;
use Drupal\Core\Entity\Annotation\ConfigEntityType;

/**
* Defines the RDF entity graph config entity.
*
* Used to store basic information about each RDF entity graph.
*
* @ConfigEntityType(
* id = "rdf_entity_graph",
* label = @Translation("RDF Graph"),
* config_prefix = "graph",
* entity_keys = {
* "id" = "id",
* "label" = "name",
* "status" = "status"
* },
* config_export = {
* "id",
* "name",
* "description",
* },
* )
*/
class RdfEntityGraph extends ConfigEntityBase {

/**
* Default graph.
*
* @var string
*/
const DEFAULT = 'default';

/**
* The unique ID of this RDF entity graph.
*
* @var string
*/
protected $id;

/**
* The label of the RDF entity graph.
*
* @var string
*/
protected $name;

/**
* The description of the RDF entity graph.
*
* @var string
*/
protected $description;

}

0 comments on commit a946220

Please sign in to comment.