< Summary

Information
Class: ValidateLib.UtilityClasses.CommonPropertiesPrefixes
Assembly: validatelib.dll
File(s): C:\skola_karlovka\RP\code\csv-validator\CSV_Validator\ValidateLib\UtilityClasses\CommonPropertiesPrefixes.cs
Line coverage
98%
Covered lines: 58
Uncovered lines: 1
Coverable lines: 59
Total lines: 84
Line coverage: 98.3%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBlocks covered Blocks not covered
CommonPropertiesPrefixes()480
ExpandPrefix(...)63
IsPrefixedName(...)70

File(s)

C:\skola_karlovka\RP\code\csv-validator\CSV_Validator\ValidateLib\UtilityClasses\CommonPropertiesPrefixes.cs

#LineLine coverage
 1namespace ValidateLib.UtilityClasses
 2{
 3    public class CommonPropertiesPrefixes
 4    {
 5
 16        public static Dictionary<string, string> map = new Dictionary<string, string>()
 17        {
 18            { "as", "https://www.w3.org/ns/activitystreams#" },
 19            { "cc", "http://creativecommons.org/ns#"},
 110            { "csvw", "http://www.w3.org/ns/csvw#" },
 111            { "ctag", "http://commontag.org/ns#" },
 112            { "dcat", "http://www.w3.org/ns/dcat#" },
 113            { "dc", "http://purl.org/dc/terms/" },
 114            { "dc11", "http://purl.org/dc/elements/1.1/" },
 115            { "dcterms", "http://purl.org/dc/terms/" },
 116            { "dqv", "http://www.w3.org/ns/dqv#" },
 117            { "duv", "https://www.w3.org/ns/duv#" },
 118            { "foaf", "http://xmlns.com/foaf/0.1/" },
 119            { "gr", "http://purl.org/goodrelations/v1#" },
 120            { "grddl", "http://www.w3.org/2003/g/data-view#" },
 121            { "ical", "http://www.w3.org/2002/12/cal/icaltzd#" },
 122            { "jsonld", "http://www.w3.org/ns/json-ld#" },
 123            { "ldp", "http://www.w3.org/ns/ldp#" },
 124            { "ma", "http://www.w3.org/ns/ma-ont#" },
 125            { "oa", "http://www.w3.org/ns/oa#" },
 126            { "odrl", "http://www.w3.org/ns/odrl/2/" },
 127            { "og", "http://ogp.me/ns#" },
 128            { "org", "http://www.w3.org/ns/org#" },
 129            { "owl", "http://www.w3.org/2002/07/owl#" },
 130            { "prov", "http://www.w3.org/ns/prov#" },
 131            { "qb", "http://purl.org/linked-data/cube#" },
 132            { "rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#" },
 133            { "rdfa", "http://www.w3.org/ns/rdfa#" },
 134            { "rdfs", "http://www.w3.org/2000/01/rdf-schema#" },
 135            { "rev", "http://purl.org/stuff/rev#" },
 136            { "rif", "http://www.w3.org/2007/rif#" },
 137            { "rr", "http://www.w3.org/ns/r2rml#" },
 138            { "schema", "http://schema.org/" },
 139            { "sd", "http://www.w3.org/ns/sparql-service-description#" },
 140            { "sioc", "http://rdfs.org/sioc/ns#" },
 141            { "skos", "http://www.w3.org/2004/02/skos/core#" },
 142            { "skosxl", "http://www.w3.org/2008/05/skos-xl#" },
 143            { "ssn", "http://www.w3.org/ns/ssn/" },
 144            { "sosa", "http://www.w3.org/ns/sosa/" },
 145            { "time", "http://www.w3.org/2006/time#" },
 146            { "v", "http://rdf.data-vocabulary.org/#" },
 147            { "vcard", "http://www.w3.org/2006/vcard/ns#" },
 148            { "void", "http://rdfs.org/ns/void#" },
 149            { "wdr", "http://www.w3.org/2007/05/powder#" },
 150            { "wdrs", "http://www.w3.org/2007/05/powder-s#" },
 151            { "xhv", "http://www.w3.org/1999/xhtml/vocab#" },
 152            { "xml", "http://www.w3.org/XML/1998/namespace" },
 153            { "xsd", "http://www.w3.org/2001/XMLSchema#" },
 154        };
 55        public static string ExpandPrefix(string prefixedString)
 56        {
 157            string[] stringParts = prefixedString.Split(":");
 158            if (stringParts.Count() == 2)
 59            {
 160                if (map.ContainsKey(stringParts[0]))
 61                {
 062                    return map[stringParts[0]] + stringParts[1];
 63                }
 64            }
 165            return prefixedString;
 66        }
 67
 68        public static bool IsPrefixedName(string prefixedName)
 69        {
 170            string[] stringParts = prefixedName.Split(":");
 171            if (stringParts.Count() == 2)
 72            {
 173                if (map.ContainsKey(stringParts[0]))
 74                {
 175                    return true;
 76                }
 77            }
 178            return false;
 79        }
 80
 81    }
 82
 83
 84}