public static NodeGenerator Create() { var ng = new NodeGenerator(); ng.SpecialTypes = new SpecialTypesClass(ng); return(ng); }
public NamedGraphsByFolders(DirectoryInfo directory, NodeGenerator ng, Func<DirectoryInfo, IGraph> graphCtor, Action<DirectoryInfo> graphDrop) : base(ng, s => graphCtor(new DirectoryInfo(directory +"/"+ CodeGraphName2DirName(s))), s=> graphDrop(new DirectoryInfo(directory +"/"+ CodeGraphName2DirName(s)))) { if(!directory.Exists) directory.Create(); foreach (var graphDir in directory.EnumerateDirectories()) named.Add(DecodeDirName2GraphName(graphDir.Name), graphCtor(graphDir)); }
public static ObjectVariants ToOVariant(this object @object, NodeGenerator nt = null) { if (nt != null) { var nodeGeneratorInt = nt as NodeGeneratorInt; if (nodeGeneratorInt != null) return Writable2OVariant((object[]) @object, nodeGeneratorInt.coding_table.GetStringByCode); } return Writable2OVariant((object[]) @object); }
public static ObjectVariants ToOVariant(this object @object, NodeGenerator nt = null) { if (nt != null) { var nodeGeneratorInt = nt as NodeGeneratorInt; if (nodeGeneratorInt != null) { return(Writable2OVariant((object[])@object, nodeGeneratorInt.coding_table.GetString)); } } return(Writable2OVariant((object[])@object)); }
//private const string rdf_syntax_ns = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"; //private const string xmlSchemaNs = "http://www.w3.org/2001/XMLSchema#"; //private const string xmlSchemaPrefix="xsd:"; //public static string[] GetAll() //{ // return new[] // { // // String,Bool,Decimal,Integer, Float, Double, // // Date, Time, DateTime, DateTimeStamp, // // GYear, GMonth, GDay, GYearMonth, GMonthDay, Duration ,YearMonthDuration , DayTimeDuration, // // Byte, Short, Int, Long, UnsignedByte, unsignedShort, unsignedInt, unsignedLong, positiveInteger, nonNegativeInteger, negativeInteger, nonPositiveInteger, // //hexBinary, base64Binary, anyURI, language, normalizedString, token, NMTOKEN, Name, NCName // Nil ,RdfFirst, RdfRest, RdfType // }; //} public SpecialTypesClass(NodeGenerator nodeGenerator) { // date =nodeGenerator. CreateUriNode(Date); // @string = nodeGenerator.CreateUriNode(String); // //simpleLiteral = simple_literal_equals_string_literal // // ? String // // : nodeGenerator.CreateUriNode(SpecialTypes.SimpleLiteral); // langString = nodeGenerator.CreateUriNode(String); // integer = nodeGenerator.CreateUriNode(Integer); // @decimal = nodeGenerator.CreateUriNode(Decimal); // @double = nodeGenerator.CreateUriNode(Double); // @bool = nodeGenerator.CreateUriNode(Bool); // @float = nodeGenerator.CreateUriNode(Float); // timeDuration = nodeGenerator.CreateUriNode(DayTimeDuration); // dateTime = nodeGenerator.CreateUriNode(DateTime); //nil = nodeGenerator.AddIri(Nil); //first = nodeGenerator.AddIri(RdfFirst); //rest = nodeGenerator.AddIri(RdfRest); type = nodeGenerator.AddIri(RdfType); }
public static NodeGenerator Create() { var ng = new NodeGenerator(); ng.SpecialTypes=new SpecialTypesClass(ng); return ng; }
//private const string rdf_syntax_ns = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"; //private const string xmlSchemaNs = "http://www.w3.org/2001/XMLSchema#"; //private const string xmlSchemaPrefix="xsd:"; //public static string[] GetAll() //{ // return new[] // { // // String,Bool,Decimal,Integer, Float, Double, // // Date, Time, DateTime, DateTimeStamp, // // GYear, GMonth, GDay, GYearMonth, GMonthDay, Duration ,YearMonthDuration , DayTimeDuration, // // Byte, Short, Int, Long, UnsignedByte, unsignedShort, unsignedInt, unsignedLong, positiveInteger, nonNegativeInteger, negativeInteger, nonPositiveInteger, // //hexBinary, base64Binary, anyURI, language, normalizedString, token, NMTOKEN, Name, NCName // Nil ,RdfFirst, RdfRest, RdfType // }; //} public SpecialTypesClass(NodeGenerator nodeGenerator) { // date =nodeGenerator. CreateUriNode(Date); // @string = nodeGenerator.CreateUriNode(String); // //simpleLiteral = simple_literal_equals_string_literal // // ? String // // : nodeGenerator.CreateUriNode(SpecialTypes.SimpleLiteral); // langString = nodeGenerator.CreateUriNode(String); // integer = nodeGenerator.CreateUriNode(Integer); // @decimal = nodeGenerator.CreateUriNode(Decimal); // @double = nodeGenerator.CreateUriNode(Double); // @bool = nodeGenerator.CreateUriNode(Bool); // @float = nodeGenerator.CreateUriNode(Float); // timeDuration = nodeGenerator.CreateUriNode(DayTimeDuration); // dateTime = nodeGenerator.CreateUriNode(DateTime); //nil = nodeGenerator.AddIri(Nil); //first = nodeGenerator.AddIri(RdfFirst); //rest = nodeGenerator.AddIri(RdfRest); type = nodeGenerator.AddIri(RdfType); }