summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/SemanticMediaWiki/src/NamespaceUriFinder.php
blob: b1635548be0e3d5a2d992205c2ac35f1410c1eb5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php

namespace SMW;

/**
 * @license GNU GPL v2+
 * @since 2.4
 *
 * @author mwjames
 */
class NamespaceUriFinder {

	/**
	 * @var array
	 */
	private static $namespaceUriList = [
		'owl'   => 'http://www.w3.org/2002/07/owl#',
		'rdf'   => 'http://www.w3.org/1999/02/22-rdf-syntax-ns#',
		'rdfs'  => 'http://www.w3.org/2000/01/rdf-schema#',
		'swivt' => 'http://semantic-mediawiki.org/swivt/1.0#',
		'xsd'   => 'http://www.w3.org/2001/XMLSchema#',
		'skos'  => 'http://www.w3.org/2004/02/skos/core#',
		'foaf'  => 'http://xmlns.com/foaf/0.1/',
		'dc'    => 'http://purl.org/dc/elements/1.1/'
	];

	/**
	 * @since 2.4
	 *
	 * @param string $key
	 *
	 * @return false|string
	 */
	public static function getUri( $key ) {

		$key = strtolower( $key );

		if ( isset( self::$namespaceUriList[$key] ) ) {
			return self::$namespaceUriList[$key];
		}

		return false;
	}

}