Mapping   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 41
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 12 3
1
<?php declare(strict_types = 1);
2
3
namespace JSKOS;
4
5
use JSKOS\Item;
6
7
/**
8
 * A JSKOS Mapping.
9
 *
10
 * @see https://gbv.github.io/jskos/jskos.html#concept-mappings
11
 */
12
class Mapping extends Resource
13
{
14
    const TYPES = [
15
        'http://www.w3.org/2004/02/skos/core#mappingRelation',
16
        'http://www.w3.org/2004/02/skos/core#closeMatch',
17
        'http://www.w3.org/2004/02/skos/core#exactMatch',
18
        'http://www.w3.org/2004/02/skos/core#broadMatch',
19
        'http://www.w3.org/2004/02/skos/core#narrowMatch',
20
        'http://www.w3.org/2004/02/skos/core#relatedMatch',
21
    ];
22
23
    const FIELDS = [
24
        # TODO
25
    ];
26
27
    public $from;
28
    public $to;
29
30
    public $fromScheme;
31
    public $toScheme;
32
33
    public $mappingRelevance; // experimental
34
35
    /**
36
     * Create a new mapping.
37
     *
38
     * @param String|Array|Resource JSON data to copy
39
     */
40
    public function __construct($data = null)
41
    {
42
        parent::__construct($data);
43
44
        if (!$this->from) {
45
            $this->from = new ConceptBundle();
46
        }
47
48
        if (!$this->to) {
49
            $this->to = new ConceptBundle();
50
        }
51
    }
52
}
53