| | 1 | | namespace ValidateLib.UtilityClasses |
| | 2 | | { |
| | 3 | | public class CommonPropertiesPrefixes |
| | 4 | | { |
| | 5 | |
|
| 1 | 6 | | public static Dictionary<string, string> map = new Dictionary<string, string>() |
| 1 | 7 | | { |
| 1 | 8 | | { "as", "https://www.w3.org/ns/activitystreams#" }, |
| 1 | 9 | | { "cc", "http://creativecommons.org/ns#"}, |
| 1 | 10 | | { "csvw", "http://www.w3.org/ns/csvw#" }, |
| 1 | 11 | | { "ctag", "http://commontag.org/ns#" }, |
| 1 | 12 | | { "dcat", "http://www.w3.org/ns/dcat#" }, |
| 1 | 13 | | { "dc", "http://purl.org/dc/terms/" }, |
| 1 | 14 | | { "dc11", "http://purl.org/dc/elements/1.1/" }, |
| 1 | 15 | | { "dcterms", "http://purl.org/dc/terms/" }, |
| 1 | 16 | | { "dqv", "http://www.w3.org/ns/dqv#" }, |
| 1 | 17 | | { "duv", "https://www.w3.org/ns/duv#" }, |
| 1 | 18 | | { "foaf", "http://xmlns.com/foaf/0.1/" }, |
| 1 | 19 | | { "gr", "http://purl.org/goodrelations/v1#" }, |
| 1 | 20 | | { "grddl", "http://www.w3.org/2003/g/data-view#" }, |
| 1 | 21 | | { "ical", "http://www.w3.org/2002/12/cal/icaltzd#" }, |
| 1 | 22 | | { "jsonld", "http://www.w3.org/ns/json-ld#" }, |
| 1 | 23 | | { "ldp", "http://www.w3.org/ns/ldp#" }, |
| 1 | 24 | | { "ma", "http://www.w3.org/ns/ma-ont#" }, |
| 1 | 25 | | { "oa", "http://www.w3.org/ns/oa#" }, |
| 1 | 26 | | { "odrl", "http://www.w3.org/ns/odrl/2/" }, |
| 1 | 27 | | { "og", "http://ogp.me/ns#" }, |
| 1 | 28 | | { "org", "http://www.w3.org/ns/org#" }, |
| 1 | 29 | | { "owl", "http://www.w3.org/2002/07/owl#" }, |
| 1 | 30 | | { "prov", "http://www.w3.org/ns/prov#" }, |
| 1 | 31 | | { "qb", "http://purl.org/linked-data/cube#" }, |
| 1 | 32 | | { "rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#" }, |
| 1 | 33 | | { "rdfa", "http://www.w3.org/ns/rdfa#" }, |
| 1 | 34 | | { "rdfs", "http://www.w3.org/2000/01/rdf-schema#" }, |
| 1 | 35 | | { "rev", "http://purl.org/stuff/rev#" }, |
| 1 | 36 | | { "rif", "http://www.w3.org/2007/rif#" }, |
| 1 | 37 | | { "rr", "http://www.w3.org/ns/r2rml#" }, |
| 1 | 38 | | { "schema", "http://schema.org/" }, |
| 1 | 39 | | { "sd", "http://www.w3.org/ns/sparql-service-description#" }, |
| 1 | 40 | | { "sioc", "http://rdfs.org/sioc/ns#" }, |
| 1 | 41 | | { "skos", "http://www.w3.org/2004/02/skos/core#" }, |
| 1 | 42 | | { "skosxl", "http://www.w3.org/2008/05/skos-xl#" }, |
| 1 | 43 | | { "ssn", "http://www.w3.org/ns/ssn/" }, |
| 1 | 44 | | { "sosa", "http://www.w3.org/ns/sosa/" }, |
| 1 | 45 | | { "time", "http://www.w3.org/2006/time#" }, |
| 1 | 46 | | { "v", "http://rdf.data-vocabulary.org/#" }, |
| 1 | 47 | | { "vcard", "http://www.w3.org/2006/vcard/ns#" }, |
| 1 | 48 | | { "void", "http://rdfs.org/ns/void#" }, |
| 1 | 49 | | { "wdr", "http://www.w3.org/2007/05/powder#" }, |
| 1 | 50 | | { "wdrs", "http://www.w3.org/2007/05/powder-s#" }, |
| 1 | 51 | | { "xhv", "http://www.w3.org/1999/xhtml/vocab#" }, |
| 1 | 52 | | { "xml", "http://www.w3.org/XML/1998/namespace" }, |
| 1 | 53 | | { "xsd", "http://www.w3.org/2001/XMLSchema#" }, |
| 1 | 54 | | }; |
| | 55 | | public static string ExpandPrefix(string prefixedString) |
| | 56 | | { |
| 1 | 57 | | string[] stringParts = prefixedString.Split(":"); |
| 1 | 58 | | if (stringParts.Count() == 2) |
| | 59 | | { |
| 1 | 60 | | if (map.ContainsKey(stringParts[0])) |
| | 61 | | { |
| 0 | 62 | | return map[stringParts[0]] + stringParts[1]; |
| | 63 | | } |
| | 64 | | } |
| 1 | 65 | | return prefixedString; |
| | 66 | | } |
| | 67 | |
|
| | 68 | | public static bool IsPrefixedName(string prefixedName) |
| | 69 | | { |
| 1 | 70 | | string[] stringParts = prefixedName.Split(":"); |
| 1 | 71 | | if (stringParts.Count() == 2) |
| | 72 | | { |
| 1 | 73 | | if (map.ContainsKey(stringParts[0])) |
| | 74 | | { |
| 1 | 75 | | return true; |
| | 76 | | } |
| | 77 | | } |
| 1 | 78 | | return false; |
| | 79 | | } |
| | 80 | |
|
| | 81 | | } |
| | 82 | |
|
| | 83 | |
|
| | 84 | | } |