Documentation ¶
Overview ¶
Package template defines the templates used for code generation in string format.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var AddClassMultiple = "\t\tif v, ok := in[i].(###propAllowedType###); ok {\n" +
"\t\t\tres.###propName###[v.IRI()] = v\n" +
"\t\tcontinue\n" +
"\t\t}\n"
AddClassMultiple template
var AddToMap = "\tmod.m###parentName###[res.IRI()] = res\n"
AddToMap template
var ArrayMultiple = "[i]"
ArrayMultiple template
var ArraySingle = ""
ArraySingle template
var ClassAdd = "// add###className### adds ###className### to model\n" +
"func (mod *Model) add###className###(res ###className###) {\n" +
"###newAddToMaps###" +
"\treturn\n" +
"}\n\n"
ClassAdd template
var ClassGet = "// ###className### returns all resources with given prefix\n" +
"func (mod *Model) ###className###(prefix string) (res []###className###) {\n" +
"\tfor i := range mod.m###className### {\n" +
"\t\tif strings.HasPrefix(i, prefix) {\n" +
"\t\t\tres = append(res, mod.m###className###[i])\n" +
"\t\t}\n" +
"\t}\n" +
"\treturn\n" +
"}\n\n"
ClassGet template
var ClassHeader = "package ###pkgName###\n\n" +
"import (\n" +
"###imports###" +
")\n\n"
ClassHeader template
var ClassIRI = "// IRI is the resource iri\n" +
"func (res *s###className###) IRI() (out string) {\n" +
"\tout = res.iri\n" +
"\treturn\n" +
"}\n\n"
ClassIRI template
var ClassInheritance = "// is###parentName### indicates base class\n" +
"func (res *s###className###) Is###parentName###() bool {\n" +
"\treturn true\n" +
"}\n\n"
ClassInheritance template
var ClassInit = "// InitFromNode initializes the resource from a graph node\n" +
"func (res *s###className###) InitFromNode(node *rdf.Node) (err error) {\n" +
"\tfor i := range node.Edge {\n" +
"\t\tres.propsInit(node.Edge[i])\n" +
"\t}\n" +
"\treturn\n" +
"}\n\n"
ClassInit template
var ClassInterface = "// ###className### ###comment###\n" +
"type ###className### interface {\n" +
"###interfaceMethods###" +
"###interfaceInheritance###" +
"}\n\n"
ClassInterface template
var ClassInverseMultipleMultiple = "// Set###propCapital### is setter of ###comment###\n" +
"func (res *s###className###) Set###propCapital###(in []###propBaseType###) (err error) {\n" +
"\ttemp := res.###propName###\n" +
"\tres.###propName### = make(map[string]###propType###)\n" +
"\tfor i := range temp {\n" +
"\t\ttemp[i].Del###propInverse###(res)\n" +
"\t}\n" +
"\terr = res.Add###propCapital###(in...)\n" +
"\treturn\n" +
"}\n\n" +
"// Add###propCapital### adds ###comment###\n" +
"func (res *s###className###) Add###propCapital###(in ...###propBaseType###) (err error) {\n" +
"\tfor i := range in {\n" +
"###inverseAddMultipleMultipleAllowed###" +
"\t\terr = errors.New(\"Wrong ###propType### type. Allowed types are ###allowedTypes###\")\n" +
"\t}\n" +
"\treturn\n" +
"}\n\n" +
"// Del###propCapital### deletes ###comment###\n" +
"func (res *s###className###) Del###propCapital###(in ...###propBaseType###) (err error) {\n" +
"\tfor i := range in {\n" +
"###inverseDelMultipleMultipleAllowed###" +
"\t\terr = errors.New(\"Wrong ###propType### type. Allowed types are ###allowedTypes###\")\n" +
"\t}\n" +
"\treturn\n" +
"}\n\n"
ClassInverseMultipleMultiple template
var ClassInverseMultipleSingle = "// Set###propCapital### is setter of ###comment###\n" +
"func (res *s###className###) Set###propCapital###(in []###propBaseType###) (err error) {\n" +
"\ttemp := res.###propName###\n" +
"\tres.###propName### = make(map[string]###propType###)\n" +
"\tfor i := range temp {\n" +
"\t\ttemp[i].Del###propInverse###(res)\n" +
"\t}\n" +
"\terr = res.Add###propCapital###(in...)\n" +
"\treturn\n" +
"}\n\n" +
"// Add###propCapital### adds ###comment###\n" +
"func (res *s###className###) Add###propCapital###(in ...###propBaseType###) (err error) {\n" +
"\tfor i := range in {\n" +
"\t\tif _, ok := res.###propName###[in[i].IRI()]; !ok {\n" +
"\t\t\tres.###propName###[in[i].IRI()] = in[i]\n" +
"\t\t\tin[i].Add###propInverse###(res)\n" +
"\t\t}\n" +
"\t}\n" +
"\treturn\n" +
"}\n\n" +
"// Del###propCapital### deletes ###comment###\n" +
"func (res *s###className###) Del###propCapital###(in ...###propBaseType###) (err error) {\n" +
"\tfor i := range in {\n" +
"\t\tif _, ok := res.###propName###[in[i].IRI()]; ok {\n" +
"\t\t\tdelete(res.###propName###, in[i].IRI())\n" +
"\t\t\tin[i].Del###propInverse###(res)\n" +
"\t\t}\n" +
"\t}\n" +
"\treturn\n" +
"}\n\n"
ClassInverseMultipleSingle template
var ClassInverseSingleMultiple = "// Set###propCapital### is setter of ###comment###\n" +
"func (res *s###className###) Set###propCapital###(in ###propBaseType###) (err error) {\n" +
"\tif in != nil {\n" +
"\t\tif res.###propName### != nil {\n" +
"\t\t\tif res.###propName###.IRI() != in.IRI() {\n" +
"\t\t\t\ttemp := res.###propName###\n" +
"###inverseSetSingleMultipleOne###" +
"\t\t\t}\n" +
"\t\t} else {\n" +
"###inverseSetSingleMultipleTwo###" +
"\t\t}\n" +
"\t} else {\n" +
"\t\tif res.###propName### != nil {\n" +
"\t\t\ttemp := res.###propName###\n" +
"###inverseSetSingleMultipleThree###" +
"\t\t}\n" +
"\t}\n" +
"\treturn\n" +
"}\n\n"
ClassInverseSingleMultiple template
var ClassInverseSingleSingle = "// Set###propCapital### is setter of ###comment###\n" +
"func (res *s###className###) Set###propCapital###(in ###propBaseType###) (err error) {\n" +
"\tif in != nil {\n" +
"\t\tif res.###propName### != nil {\n" +
"\t\t\tif res.###propName###.IRI() != in.IRI() {\n" +
"\t\t\t\ttemp := res.###propName###\n" +
"\t\t\t\tres.###propName### = in\n" +
"\t\t\t\ttemp.Set###propInverse###(nil)\n" +
"\t\t\t\tin.Set###propInverse###(res)\n" +
"\t\t\t}\n" +
"\t\t} else {\n" +
"\t\t\tres.###propName### = in\n" +
"\t\t\tin.Set###propInverse###(res)\n" +
"\t\t}\n" +
"\t} else {\n" +
"\t\tif res.###propName### != nil {\n" +
"\t\t\ttemp := res.###propName###\n" +
"\t\t\tres.###propName### = in\n" +
"\t\t\ttemp.Set###propInverse###(nil)\n" +
"\t\t}\n" +
"\t}\n" +
"\treturn\n" +
"}\n\n"
ClassInverseSingleSingle template
var ClassMakeMaps = "// makeMaps creates initiliazes maps\n" +
"func (res *s###className###) makeMaps() {\n" +
"###newMakeMaps###" +
"###newInitProps###" +
"\treturn\n" +
"}\n\n"
ClassMakeMaps template
var ClassNew = "// New###className### creates a new ###className###\n" +
"func (mod *Model) New###className###(iri string) (ret ###className###, err error) {\n" +
"\tif mod.Exist(iri) {\n" +
"\t\terr = errors.New(\"Resource already exists\")\n" +
"\t\treturn\n" +
"\t}\n" +
"\tres := &s###className###{}\n" +
"\tpc := propCommon{iri: iri, typ: \"###className###\", model: mod}\n" +
"\tres.propCommon = pc\n" +
"\tmod.add###className###(res)\n" +
"\tres.makeMaps()\n" +
"\tret = res\n" +
"\treturn\n" +
"}\n\n"
ClassNew template
var ClassRemove = "// RemoveObject deletes all its references in this object\n" +
"func (res *s###className###) RemoveObject(obj owl.Thing, prop string) {\n" +
"\tswitch prop {\n" +
"###removeProps###" +
"\tdefault:\n" +
"###parentRemove###" +
"\t}\n" +
"\treturn\n" +
"}\n\n"
ClassRemove template
var ClassString = "// String prints the object into a string\n" +
"func (res *s###className###) String() (ret string) {\n" +
"\tret = res.iri + \" \" + \"###className###\\n\"\n" +
"\tret += res.propsString()\n" +
"\treturn\n" +
"}\n\n"
ClassString template
var ClassStruct = "// s###className### ###comment###\n" +
"type s###className### struct {\n" +
"###structProperties###" +
"}\n\n"
ClassStruct template
var ClassToGraph = "// ToGraph creates a new owl graph node and adds it to the graph\n" +
"func (res *s###className###) ToGraph(g *rdf.Graph) {\n" +
"\tnode := owl.AddObjectToGraph(g, \"###classIRI###\", res)\n" +
"\tres.propsToGraph(node, g)\n" +
"\treturn\n" +
"}\n\n"
ClassToGraph template
var ClassToGraphNoProp = "// ToGraph creates a new owl graph node and adds it to the graph\n" +
"func (res *s###className###) ToGraph(g *rdf.Graph) {\n" +
"\towl.AddObjectToGraph(g, \"###classIRI###\", res)\n" +
"\treturn\n" +
"}\n\n"
ClassToGraphNoProp template
var CreateIndividual = "\tmod.New###individualType###(\"###individualIRI###\")\n"
CreateIndividual template
var DelClassMultiple = "\t\tif v, ok := in[i].(###propAllowedType###); ok {\n" +
"\t\t\tdelete(res.###propName###, v.IRI())\n" +
"\t\tcontinue\n" +
"\t\t}\n"
DelClassMultiple template
var DeleteFromImport = "\terr = mod.model###importName###.DeleteObject(obj)\n"
DeleteFromImport template
var DeleteFromMap = "\tdelete(mod.m###className###, obj.IRI())\n"
DeleteFromMap template
var GraphPropBool = "###indent###\towl.AddBoolPropertyToGraph(g, \"###propIRI###\", node, res.###propName######array###)\n"
GraphPropBool template
var GraphPropClass = "###indent###\towl.AddClassPropertyToGraph(g, \"###propIRI###\", node, res.###propName######array###)\n"
GraphPropClass template
var GraphPropFloat = "###indent###\towl.AddFloatPropertyToGraph(g, \"###propIRI###\", node, res.###propName######array###)\n"
GraphPropFloat template
var GraphPropInt = "###indent###\towl.AddIntPropertyToGraph(g, \"###propIRI###\", node, res.###propName######array###)\n"
GraphPropInt template
var GraphPropInterface = "###indent###\towl.AddInterfacePropertyToGraph(g, \"###propIRI###\", node, res.###propName######array###)\n"
GraphPropInterface template
var GraphPropSDate = "###indent###\towl.AddDatePropertyToGraph(g, \"###propIRI###\", node, res.###propName######array###)\n"
GraphPropSDate template
var GraphPropSDateTime = "###indent###\towl.AddDateTimePropertyToGraph(g, \"###propIRI###\", node, res.###propName######array###)\n"
GraphPropSDateTime template
var GraphPropSDateTimeStamp = "###indent###\towl.AddDateTimeStampPropertyToGraph(g, \"###propIRI###\", node, res.###propName######array###)\n"
GraphPropSDateTimeStamp template
var GraphPropSDuration = "###indent###\towl.AddDurationPropertyToGraph(g, \"###propIRI###\", node, res.###propName######array###)\n"
GraphPropSDuration template
var GraphPropSGDay = "###indent###\towl.AddGDayPropertyToGraph(g, \"###propIRI###\", node, res.###propName######array###)\n"
GraphPropSGDay template
var GraphPropSGMonth = "###indent###\towl.AddGMonthPropertyToGraph(g, \"###propIRI###\", node, res.###propName######array###)\n"
GraphPropSGMonth template
var GraphPropSGYear = "###indent###\towl.AddGYearPropertyToGraph(g, \"###propIRI###\", node, res.###propName######array###)\n"
GraphPropSGYear template
var GraphPropSGYearMonth = "###indent###\towl.AddGYearMonthPropertyToGraph(g, \"###propIRI###\", node, res.###propName######array###)\n"
GraphPropSGYearMonth template
var GraphPropSTime = "###indent###\towl.AddTimePropertyToGraph(g, \"###propIRI###\", node, res.###propName######array###)\n"
GraphPropSTime template
var GraphPropString = "###indent###\towl.AddStringPropertyToGraph(g, \"###propIRI###\", node, res.###propName######array###)\n"
GraphPropString template
var Import = "\t\"###import###\"\n"
Import template
var ImportReplace = "\treplace[\"###importIRI###\"] = \"###importName###:\"\n"
ImportReplace template
var ImportShape = "\tshape[\"###importIRI###\"] = \"box\"\n"
ImportShape template
var ImportsHeader = "package ###pkgName###\n\n" +
"import (\n" +
"\t\"errors\"\n" +
"###imports###" +
")\n\n"
ImportsHeader template
var ImportsNewGetMethods = "// New###capImportName######className### creates a new ###importName### ###className###\n" +
"func (mod *Model) New###capImportName######className###(iri string) (ret im###importName###.###className###, err error) {\n" +
"\tif mod.Exist(iri) {\n" +
"\t\terr = errors.New(\"Resource already exists\")\n" +
"\t\treturn\n" +
"\t}\n" +
"\tret, err = mod.model###importModelName###.New###importCapImportName######className###(iri)\n" +
"\tif err != nil {\n" +
"\t\treturn\n" +
"\t}\n" +
"\tmod.mThing[ret.IRI()] = ret\n" +
"\treturn\n" +
"}\n\n" +
"// ###capImportName######className### returns all resources with given prefix\n" +
"func (mod *Model) ###capImportName######className###(prefix string) (res []im###importName###.###className###) {\n" +
"\tres = mod.model###importModelName###.###importCapImportName######className###(prefix)\n" +
"\treturn\n" +
"}\n\n"
ImportsNewGetMethods template
var IndentMultiple = "\t"
IndentMultiple template
var IndentSingle = ""
IndentSingle template
var Individual = "package ###pkgName###\n\n" +
"// CreateIndividuals adds all individuals to a model\n" +
"func (mod *Model) CreateIndividuals() {\n" +
"###createIndividuals###" +
"\treturn\n" +
"}\n\n"
Individual template
var InitSwitchProp = "\tcase \"###propIRI###\":\n" +
"###PropInit###"
InitSwitchProp template
var InterfaceInheritance = "\tIs###parentName###() bool // indicates base class\n"
InterfaceInheritance template
var InterfaceInterface = "\t###propName######multi######propBaseTypeNoImp###\n"
InterfaceInterface template
var InverseAddMultipleMultiple = "\t\tif v, ok := in[i].(###propAllowedType###); ok {\n" +
"\t\t\tif _, ok := res.###propName###[v.IRI()]; !ok {\n" +
"\t\t\t\tres.###propName###[v.IRI()] = v\n" +
"\t\t\t\tv.Add###propInverse###(res)\n" +
"\t\t\t}\n" +
"\t\t\tcontinue\n" +
"\t\t}\n"
InverseAddMultipleMultiple template
var InverseDelMultipleMultiple = "\t\tif v, ok := in[i].(###propAllowedType###); ok {\n" +
"\t\t\tif _, ok := res.###propName###[v.IRI()]; !ok {\n" +
"\t\t\t\tdelete(res.###propName###, v.IRI())\n" +
"\t\t\t\tv.Del###propInverse###(res)\n" +
"\t\t\t}\n" +
"\t\t\tcontinue\n" +
"\t\t}\n"
InverseDelMultipleMultiple template
var InverseSetSingleMultipleOne = "\t\t\t\tif _, ok := in.(###propAllowedType###); ok {\n" +
"\t\t\t\t\tres.###propName### = in\n" +
"\t\t\t\t\ttemp.Set###propInverse###(nil)\n" +
"\t\t\t\t\tin.Set###propInverse###(res)\n" +
"\t\t\t\t\treturn\n" +
"\t\t\t\t}\n"
InverseSetSingleMultipleOne template
var InverseSetSingleMultipleThree = "\t\t\tif _, ok := in.(###propAllowedType###); ok {\n" +
"\t\t\t\tres.###propName### = in\n" +
"\t\t\t\ttemp.Set###propInverse###(nil)\n" +
"\t\t\t\treturn\n" +
"\t\t\t}\n"
InverseSetSingleMultipleThree template
var InverseSetSingleMultipleTwo = "\t\t\tif _, ok := in.(###propAllowedType###); ok {\n" +
"\t\t\t\tres.###propName### = in\n" +
"\t\t\t\tin.Set###propInverse###(res)\n" +
"\t\t\t\treturn\n" +
"\t\t\t}\n"
InverseSetSingleMultipleTwo template
var ModelDeleteObject = "// DeleteObject deletes an object from the model along with its references\n" +
"func (mod *Model) DeleteObject(obj owl.Thing) (err error) {\n" +
"\tif !mod.Exist(obj.IRI()) {\n" +
"\t\treturn\n" +
"\t}\n" +
"\tg := mod.ToGraph()\n" +
"\tn := g.Nodes[obj.IRI()]\n" +
"\tfor i := range n.InverseEdge {\n" +
"\t\tif subj, ok := mod.mThing[n.InverseEdge[i].Subject.Term.String()]; ok {\n" +
"\t\t\tsubj.RemoveObject(obj, n.InverseEdge[i].Pred.String())\n" +
"\t\t}\n" +
"\t}\n" +
"###deleteFromMaps###" +
"\tdelete(mod.mThing, obj.IRI())\n" +
"\treturn\n" +
"}\n\n"
ModelDeleteObject template
var ModelExists = "// Exist checks for the existance of a resource by the given iri\n" +
"func (mod *Model) Exist(iri string) (ret bool) {\n" +
"\t_, ret = mod.mThing[iri]\n" +
"\treturn\n" +
"}\n\n"
ModelExists template
var ModelHeader = "package ###pkgName###\n\n" +
"import (\n" +
"\t\"git.rwth-aachen.de/acs/public/ontology/owl/owl2go/pkg/rdf\"\n" +
"\t\"git.rwth-aachen.de/acs/public/ontology/owl/owl2go/pkg/owl\"\n" +
"\t\"io\"\n" +
")\n\n"
ModelHeader template
var ModelNew = "// NewModel creates a new model and initializes class maps\n" +
"func NewModel() (mod *Model) {\n" +
"\tmod = &Model{}\n" +
"\tmod.mThing = make(map[string]owl.Thing)\n" +
"###makeMaps###" +
"\treturn\n" +
"}\n\n"
ModelNew template
var ModelNewFromGraph = "// NewModelFromGraph creates a new model from a owl graph\n" +
"func NewModelFromGraph(g rdf.Graph) (mod *Model, err error) {\n" +
"\tmod = NewModel()\n" +
"\tfor i := range g.Nodes {\n" +
"\t\tfor j := range g.Nodes[i].Edge {\n" +
"\t\t\tif g.Nodes[i].Edge[j].Pred.String() == \"http://www.w3.org/1999/02/22-rdf-syntax-ns#type\" {\n" +
"\t\t\t\tswitch g.Nodes[i].Edge[j].Object.Term.String() {\n" +
"###newObjects###" +
"\t\t\t\tdefault:\n" +
"\t\t\t\t}\n" +
"\t\t\t}\n" +
"\t\t}\n" +
"\t}\n" +
"\tfor i := range g.Nodes {\n" +
"\t\tif res, ok := mod.mThing[g.Nodes[i].Term.String()]; ok {\n" +
"\t\t\tres.InitFromNode(g.Nodes[i])\n" +
"\t\t}\n" +
"\t}\n" +
"\treturn\n" +
"}\n\n"
ModelNewFromGraph template
var ModelNewFromJSONLD = "// NewModelFromJSONLD creates a new model from a jsonld io reader\n" +
"func NewModelFromJSONLD(input io.Reader) (mod *Model, err error) {\n" +
"\ttriples, err := rdf.DecodeJSONLD(input)\n" +
"\tif err != nil {\n" +
"\t\treturn\n" +
"\t}\n" +
"\tg, err := rdf.NewGraph(triples)\n" +
"\tif err != nil {\n" +
"\t\treturn\n" +
"\t}\n" +
"\tmod, err = NewModelFromGraph(g)\n" +
"\treturn\n" +
"}\n\n"
ModelNewFromJSONLD template
var ModelNewFromTTL = "// NewModelFromTTL creates a new model from a ttl io reader\n" +
"func NewModelFromTTL(input io.Reader) (mod *Model, err error) {\n" +
"\ttriples, err := rdf.DecodeTTL(input)\n" +
"\tif err != nil {\n" +
"\t\treturn\n" +
"\t}\n" +
"\tg, err := rdf.NewGraph(triples)\n" +
"\tif err != nil {\n" +
"\t\treturn\n" +
"\t}\n" +
"\tmod, err = NewModelFromGraph(g)\n" +
"\treturn\n" +
"}\n\n"
ModelNewFromTTL template
var ModelString = "// String prints the model\n" +
"func (mod *Model) String() (ret string) {\n" +
"\tret = \"\"\n" +
"\tfor i := range mod.mThing {\n" +
"\t\tret += mod.mThing[i].String()\n" +
"\t}\n" +
"\treturn\n" +
"}\n\n"
ModelString template
var ModelStruct = "// Model holds all objects\n" +
"type Model struct {\n" +
"\tmThing map[string]owl.Thing\n" +
"###objectMaps###" +
"}\n\n"
ModelStruct template
var ModelToDot = "// ToDot writes a dot file from an existing model\n" +
"func (mod* Model) ToDot(output io.Writer) (err error) {\n" +
"\treplace := make(map[string]string)\n" +
"\tshape := make(map[string]string)\n" +
"###importReplace###" +
"###importShape###" +
"\treplace[\"http://www.wurvoc.org/vocabularies/om-1.8/\"] = \"om:\"\n" +
"\treplace[\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"] = \"rdf:\"\n" +
"\treplace[\"http://www.w3.org/2000/01/rdf-schema#\"] = \"rdfs:\"\n" +
"\tg := mod.ToGraph()\n" +
"\tg.ToGraphvizDot(output, replace, shape)\n" +
"\treturn\n" +
"}\n\n"
ModelToDot template
var ModelToGraph = "// ToGraph extracts an owl graph from an existing model\n" +
"func (mod* Model) ToGraph() (g *rdf.Graph) {\n" +
"\tg = &rdf.Graph{}\n" +
"\tg.Nodes = make(map[string]*rdf.Node)\n" +
"\tfor i := range mod.mThing {\n" +
"\t\tmod.mThing[i].ToGraph(g)\n" +
"\t}\n" +
"\treturn\n" +
"}\n\n"
ModelToGraph template
var ModelToJSONLD = "// ToJSONLD writes a jsonld file from an existing model\n" +
"func (mod* Model) ToJSONLD(output io.Writer) (err error) {\n" +
"\tg := mod.ToGraph()\n" +
"\tnewTriples := g.ToTriples()\n" +
"\terr = rdf.EncodeJSONLD(newTriples, output)\n" +
"\treturn\n" +
"}\n\n"
ModelToJSONLD template
var ModelToTTL = "// ToTTL writes a ttl file from an existing model\n" +
"func (mod* Model) ToTTL(output io.Writer) (err error) {\n" +
"\tg := mod.ToGraph()\n" +
"\tnewTriples := g.ToTriples()\n" +
"\terr = rdf.EncodeTTL(newTriples, output)\n" +
"\treturn\n" +
"}\n\n"
ModelToTTL template
var MultiplicityMultiple = "Add"
MultiplicityMultiple template
var MultiplicitySingle = "Set"
MultiplicitySingle template
var NewImport = "\tmod.model###importName### = im###importName###.NewModel()\n"
NewImport template
var NewInitPropClassMultiple = "\tif v, ok := res.model.m###propType###[\"###value###\"]; ok {\n" +
"\t\tres.Add###propCapital###(v)\n" +
"\t}\n"
NewInitPropClassMultiple template
var NewInitPropClassSingle = "\tif v, ok := res.model.m###propType###[\"###value###\"]; ok {\n" +
"\t\tres.Set###propCapital###(v)\n" +
"\t}\n"
NewInitPropClassSingle template
var NewInitPropLiteralMultiple = "\tAdd###propCapital###(###value###)\n"
NewInitPropLiteralMultiple template
var NewInitPropLiteralSingle = "\tSet###propCapital###(###value###)\n"
NewInitPropLiteralSingle template
var NewMakeMap = "\tres.###propName### = make(map[string]###propType###)\n"
NewMakeMap template
var NewObject = "\t\t\t\tcase \"###classIRI###\":\n" +
"\t\t\t\t\tmod.New###capImportName######className###(g.Nodes[i].Term.String())\n"
NewObject template
var NewObjectMap = "\tmod.m###className### = make(map[string]###className###)\n"
NewObjectMap template
var OSSHeader = "/*\n" +
"This file is auto-generated by OWL2Go (https://git.rwth-aachen.de/acs/public/ontology/owl/owl2go).\n\n" +
"Copyright 2020 Institute for Automation of Complex Power Systems,\n" +
"E.ON Energy Research Center, RWTH Aachen University\n\n" +
"This project is licensed under either of\n" +
"- Apache License, Version 2.0\n" +
"- MIT License\n" +
"at your option.\n\n" +
"Apache License, Version 2.0:\n\n" +
"Licensed under the Apache License, Version 2.0 (the \"License\");\n" +
"you may not use this file except in compliance with the License.\n" +
"You may obtain a copy of the License at\n\n" +
" http://www.apache.org/licenses/LICENSE-2.0\n\n" +
"Unless required by applicable law or agreed to in writing, software\n" +
"distributed under the License is distributed on an \"AS IS\" BASIS,\n" +
"WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n" +
"See the License for the specific language governing permissions and\n" +
"limitations under the License.\n\n" +
"MIT License:\n\n" +
"Permission is hereby granted, free of charge, to any person obtaining a copy\n" +
"of this software and associated documentation files (the \"Software\"), to deal\n" +
"in the Software without restriction, including without limitation the rights\n" +
"to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n" +
"copies of the Software, and to permit persons to whom the Software is\n" +
"furnished to do so, subject to the following conditions:\n\n" +
"The above copyright notice and this permission notice shall be included in\n" +
"all copies or substantial portions of the Software.\n\n" +
"THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n" +
"IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n" +
"FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n" +
"AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n" +
"LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n" +
"OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n" +
"THE SOFTWARE.\n" +
"*/\n\n"
OSSHeader template
var PropBool = "\t\tif obj, err := strconv.ParseBool(in); err == nil {\n" +
"\t\t\tres.###Multiplicity######propCapital###(obj)\n" +
"\t\t}\n"
PropBool template
var PropClassBaseThing = "\t\tif obj, ok := res.model.mThing[pred.Object.Term.String()]; ok {\n" +
"\t\t\tres.###Multiplicity######propCapital###(obj)\n" +
"\t\t}\n"
PropClassBaseThing template
var PropClassDefault = "\t\tif obj, ok := res.model.m###propBaseType###[pred.Object.Term.String()]; ok {\n" +
"\t\t\tres.###Multiplicity######propCapital###(obj)\n" +
"\t\t}\n"
PropClassDefault template
var PropClassImport = "\t\tif temp := res.model.###capImportName######propBaseType###(pred.Object.Term.String()); len(temp) > 0 {\n" +
"\t\t\tfor j := range temp {\n" +
"\t\t\t\tif temp[j].IRI() == pred.Object.Term.String() {\n" +
"\t\t\t\t\tres.###Multiplicity######propCapital###(temp[j])\n" +
"\t\t\t\t}\n" +
"\t\t\t}\n" +
"\t\t}\n"
PropClassImport template
var PropDate = "\t\tif obj, err := time.Parse(\"2006-01-02Z07:00\", pred.Object.Term.String()); err == nil {\n" +
"\t\t\tres.###Multiplicity######propCapital###(obj)\n" +
"\t\t}\n"
PropDate template
var PropDateTime = "\t\tif obj, err := time.Parse(time.RFC3339, pred.Object.Term.String()); err == nil {\n" +
"\t\t\tres.###Multiplicity######propCapital###(obj)\n" +
"\t\t}\n"
PropDateTime template
var PropDateTimeStamp = "\t\tif obj, err := time.Parse(time.RFC3339, pred.Object.Term.String()); err == nil {\n" +
"\t\t\tres.###Multiplicity######propCapital###(obj)\n" +
"\t\t}\n"
PropDateTimeStamp template
var PropDuration = "\t\tif obj, err := owl.ParseXsdDuration(pred.Object.Term.String()); err == nil {\n" +
"\t\t\tres.###Multiplicity######propCapital###(obj)\n" +
"\t\t}\n"
PropDuration template
var PropFloat = "\t\tif obj, err := strconv.ParseFloat(pred.Object.Term.String(), 32); err == nil {\n" +
"\t\t\tres.###Multiplicity######propCapital###(float64(obj))\n" +
"\t\t}\n"
PropFloat template
var PropGDay = "\t\tif obj, err := time.Parse(\"---02\", pred.Object.Term.String()); err == nil {\n" +
"\t\t\tres.###Multiplicity######propCapital###(obj)\n" +
"\t\t}\n"
PropGDay template
var PropGMonth = "\t\tif obj, err := time.Parse(\"--01\", pred.Object.Term.String()); err == nil {\n" +
"\t\t\tres.###Multiplicity######propCapital###(obj)\n" +
"\t\t}\n"
PropGMonth template
var PropGYear = "\t\tif obj, err := time.Parse(\"2006\", pred.Object.Term.String()); err == nil {\n" +
"\t\t\tres.###Multiplicity######propCapital###(obj)\n" +
"\t\t}\n"
PropGYear template
var PropGYearMonth = "\t\tif obj, err := time.Parse(\"2006-01\", pred.Object.Term.String()); err == nil {\n" +
"\t\t\tres.###Multiplicity######propCapital###(obj)\n" +
"\t\t}\n"
PropGYearMonth template
var PropInitBool = "\tif obj, err := strconv.ParseBool(in); err == nil {\n" +
"\t\tres.###Multiplicity######propCapital###(obj)\n" +
"\t}\n"
PropInitBool template
var PropInitClassBaseThing = "\tif obj, ok := model.mThing[in]; ok {\n" +
"\t\tres.###Multiplicity######propCapital###(obj)\n" +
"\t}\n"
PropInitClassBaseThing template
var PropInitClassDefault = "\tif obj, ok := model.m###propBaseType###[in]; ok {\n" +
"\t\tres.###Multiplicity######propCapital###(obj)\n" +
"\t}\n"
PropInitClassDefault template
var PropInitClassImport = "\tif temp := model.###capImportName######propBaseType###(in); len(temp) > 0 {\n" +
"\t\tfor j := range temp {\n" +
"\t\t\tif temp[j].IRI() == in {\n" +
"\t\t\t\tres.###Multiplicity######propCapital###(temp[j])\n" +
"\t\t\t}\n" +
"\t\t}\n" +
"\t}\n"
PropInitClassImport template
var PropInitClassNonInverse = "\t\tres.###propLongName###.init(res.model, pred.Object.Term.String())\n"
PropInitClassNonInverse template
var PropInitDate = "\tif obj, err := time.Parse(\"2006-01-02Z07:00\", in); err == nil {\n" +
"\t\tres.###Multiplicity######propCapital###(obj)\n" +
"\t}\n"
PropInitDate template
var PropInitDateTime = "\tif obj, err := time.Parse(time.RFC3339, in); err == nil {\n" +
"\t\tres.###Multiplicity######propCapital###(obj)\n" +
"\t}\n"
PropInitDateTime template
var PropInitDateTimeStamp = "\tif obj, err := time.Parse(time.RFC3339, in); err == nil {\n" +
"\t\tres.###Multiplicity######propCapital###(obj)\n" +
"\t}\n"
PropInitDateTimeStamp template
var PropInitDuration = "\tif obj, err := owl.ParseXsdDuration(in); err == nil {\n" +
"\t\tres.###Multiplicity######propCapital###(obj)\n" +
"\t}\n"
PropInitDuration template
var PropInitFloat = "\tif obj, err := strconv.ParseFloat(in, 32); err == nil {\n" +
"\t\tres.###Multiplicity######propCapital###(float64(obj))\n" +
"\t}\n"
PropInitFloat template
var PropInitGDay = "\tif obj, err := time.Parse(\"---02\", in); err == nil {\n" +
"\t\tres.###Multiplicity######propCapital###(obj)\n" +
"\t}\n"
PropInitGDay template
var PropInitGMonth = "\tif obj, err := time.Parse(\"--01\", in); err == nil {\n" +
"\t\tres.###Multiplicity######propCapital###(obj)\n" +
"\t}\n"
PropInitGMonth template
var PropInitGYear = "\tif obj, err := time.Parse(\"2006\", in); err == nil {\n" +
"\t\tres.###Multiplicity######propCapital###(obj)\n" +
"\t}\n"
PropInitGYear template
var PropInitGYearMonth = "\tif obj, err := time.Parse(\"2006-01\", in); err == nil {\n" +
"\t\tres.###Multiplicity######propCapital###(obj)\n" +
"\t}\n"
PropInitGYearMonth template
var PropInitInt = "\tif obj, err := strconv.Atoi(in); err == nil {\n" +
"\t\tres.###Multiplicity######propCapital###(obj)\n" +
"\t}\n"
PropInitInt template
var PropInitInterface = "\tres.###Multiplicity######propCapital###(in)\n"
PropInitInterface template
var PropInitLiteralNonInverse = "\t\tres.###propLongName###.init(pred.Object.Term.String())\n"
PropInitLiteralNonInverse template
var PropInitString = "\tres.###Multiplicity######propCapital###(in)\n"
PropInitString template
var PropInitTime = "\tif obj, err := time.Parse(\"15:04:05Z07:00\", in); err == nil {\n" +
"\t\tres.###Multiplicity######propCapital###(obj)\n" +
"\t}\n"
PropInitTime template
var PropInt = "\t\tif obj, err := strconv.Atoi(); err == nil {\n" +
"\t\t\tres.###Multiplicity######propCapital###(obj)\n" +
"\t\t}\n"
PropInt template
var PropString = "\t\tres.###Multiplicity######propCapital###()\n"
PropString template
var PropTime = "\t\tif obj, err := time.Parse(\"15:04:05Z07:00\", pred.Object.Term.String()); err == nil {\n" +
"\t\t\tres.###Multiplicity######propCapital###(obj)\n" +
"\t\t}\n"
PropTime template
var PropertyAddClassMultiple = "// Add###propCapital### adds ###comment###\n" +
"func (res *###propLongName###) Add###propCapital###(in ...###propBaseType###) (err error) {\n" +
"\tfor i := range in {\n" +
"###addClassMultiple###" +
"\t\terr = errors.New(\"Wrong ###propType### type. Allowed types are ###propAllowedTypes###\")\n" +
"\t}\n" +
"\treturn\n" +
"}\n\n"
PropertyAddClassMultiple template
var PropertyAddClassSingle = "// Add###propCapital### adds ###comment###\n" +
"func (res *###propLongName###) Add###propCapital###(in ...###propBaseType###) (err error) {\n" +
"\tfor i := range in {\n" +
"\t\tres.###propName###[in[i].IRI()] = in[i]\n" +
"\t}\n" +
"\treturn\n" +
"}\n\n"
PropertyAddClassSingle template
var PropertyAddLiteral = "// Add###propCapital### adds ###comment###\n" +
"func (res *###propLongName###) Add###propCapital###(in ...###propBaseType###) (err error) {\n" +
"\tres.###propName### = append(res.###propName###, in...)\n" +
"\treturn\n" +
"}\n\n"
PropertyAddLiteral template
var PropertyDelClassMultiple = "// Del###propCapital### deletes ###comment###\n" +
"func (res *###propLongName###) Del###propCapital###(in ...###propBaseType###) (err error) {\n" +
"\tfor i := range in {\n" +
"###delClassMultiple###" +
"\t\terr = errors.New(\"Wrong ###propType### type. Allowed types are ###propAllowedTypes###\")\n" +
"\t}\n" +
"\treturn\n" +
"}\n\n"
PropertyDelClassMultiple template
var PropertyDelClassSingle = "// Del###propCapital### deletes ###comment###\n" +
"func (res *###propLongName###) Del###propCapital###(in ...###propBaseType###) (err error) {\n" +
"\tfor i := range in {\n" +
"\t\tdelete(res.###propName###, in[i].IRI())\n" +
"\t}\n" +
"\treturn\n" +
"}\n\n"
PropertyDelClassSingle template
var PropertyDelLiteral = "// Del###propCapital### deletes ###comment###\n" +
"func (res *###propLongName###) Del###propCapital###(in ...###propBaseType###) (err error) {\n" +
"\tfor i := range in {\n" +
"\t\tfor j := range res.###propName### {\n" +
"\t\t\tif in[i] == res.###propName###[j] {\n" +
"\t\t\t\tres.###propName### = append(res.###propName###[:j], res.###propName###[j:]...)\n" +
"\t\t\t\tbreak\n" +
"\t\t\t}\n" +
"\t\t}\n" +
"\t}\n" +
"\treturn\n" +
"}\n\n"
PropertyDelLiteral template
var PropertyGetMultipleClass = "// ###propCapital### ###comment###\n" +
"func (res *###propLongName###) ###propCapital###() (out []###propBaseType###) {\n" +
"\tout = make([]###propBaseType###, len(res.###propName###))\n" +
"\tindex := 0\n" +
"\tfor i := range res.###propName### {\n" +
"\t\tout[index] = res.###propName###[i]\n" +
"\t\tindex++\n" +
"\t}\n" +
"\treturn\n" +
"}\n\n"
PropertyGetMultipleClass template
var PropertyGetMultipleLiteral = "// ###propCapital### ###comment###\n" +
"func (res *###propLongName###) ###propCapital###() (out []###propBaseType###) {\n" +
"\tout = res.###propName###\n" +
"\treturn\n" +
"}\n\n"
PropertyGetMultipleLiteral template
var PropertyGetSingle = "// ###propCapital### ###comment###\n" +
"func (res *###propLongName###) ###propCapital###() (out ###propBaseType###) {\n" +
"\tout = res.###propName###\n" +
"\treturn\n" +
"}\n\n"
PropertyGetSingle template
var PropertyGraphMultiple = "// toGraph adds all predicates corresponding to the property to an owl graph\n" +
"func (res *###propLongName###) toGraph(node *rdf.Node, g *rdf.Graph) {\n" +
"\tfor i := range res.###propName### {\n" +
"###graphProp###" +
"\t}\n" +
"\treturn\n" +
"}\n\n"
PropertyGraphMultiple template
var PropertyGraphSingle = "// toGraph adds all predicates corresponding to the property to an owl graph\n" +
"func (res *###propLongName###) toGraph(node *rdf.Node, g *rdf.Graph) {\n" +
"###graphProp###" +
"\treturn\n" +
"}\n\n"
PropertyGraphSingle template
var PropertyHeader = "package ###pkgName###\n\n" +
"###propImports###"
PropertyHeader template
var PropertyIRI = "// IRI is the resource iri\n" +
"func (res *propCommon) IRI() (out string) {\n" +
"\tout = res.iri\n" +
"\treturn\n" +
"}\n\n"
PropertyIRI template
var PropertyInitClass = "// init initializes the property\n" +
"func (res *###propLongName###) init(model *Model, in string) {\n" +
"###PropInit###" +
"\treturn\n" +
"}\n\n"
PropertyInitClass template
var PropertyInitLiteral = "// init initializes the property\n" +
"func (res *###propLongName###) init(in string) {\n" +
"###PropInit###" +
"\treturn\n" +
"}\n\n"
PropertyInitLiteral template
var PropertyInterfaceMultiple = "// ###propName###Multiple###propBaseTypeNoImp### is interface for property ###propCapital### with multiple type ###propBaseType###\n" +
"type ###propName###Multiple###propBaseTypeNoImp### interface {\n" +
"\t###propCapital###() []###propBaseType### // ###comment###\n" +
"\tSet###propCapital###([]###propBaseType###) error // set ###comment###\n" +
"\tAdd###propCapital###(...###propBaseType###) error // add ###comment###\n" +
"\tDel###propCapital###(...###propBaseType###) error // delete ###comment###\n" +
"}\n\n"
PropertyInterfaceMultiple template
var PropertyInterfaceSingle = "// ###propName###Single###propBaseTypeNoImp### is interface for property ###propCapital### with single type ###propBaseType###\n" +
"type ###propName###Single###propBaseTypeNoImp### interface {\n" +
"\t###propCapital###() ###propBaseType### // ###comment###\n" +
"\tSet###propCapital###(###propBaseType###) error // set ###comment###\n" +
"}\n\n"
PropertyInterfaceSingle template
var PropertyMultipleRemove = "// removeObject removes object from property\n" +
"func (res *###propLongName###) removeObject(obj owl.Thing) {\n" +
"\tif v, ok := obj.(###propBaseType###); ok {\n" +
"\t\tres.Del###propCapital###(v)\n" +
"\t}\n" +
"\treturn\n" +
"}\n\n"
PropertyMultipleRemove template
var PropertySetMultipleClass = "// Set###propCapital### is setter of ###comment###\n" +
"func (res *###propLongName###) Set###propCapital###(in []###propBaseType###) (err error) {\n" +
"\tres.###propName### = make(map[string]###propType###)\n" +
"\terr = res.Add###propCapital###(in...)\n" +
"\treturn\n" +
"}\n\n"
PropertySetMultipleClass template
var PropertySetMultipleLiteral = "// Set###propCapital### is setter of ###comment###\n" +
"func (res *###propLongName###) Set###propCapital###(in []###propBaseType###) (err error) {\n" +
"\tres.###propName### = in\n" +
"\treturn\n" +
"}\n\n"
PropertySetMultipleLiteral template
var PropertySetSingleClassMultiple = "// Set###propCapital### is setter of ###comment###\n" +
"func (res *###propLongName###) Set###propCapital###(in ###propBaseType###) (err error) {\n" +
"###setSingleClassMultiple###" +
"\terr = errors.New(\"Wrong ###propType### type. Allowed types are ###propAllowedTypes###\")\n" +
"\treturn\n" +
"}\n\n"
PropertySetSingleClassMultiple template
var PropertySetSingleClassSingle = "// Set###propCapital### is setter of ###comment###\n" +
"func (res *###propLongName###) Set###propCapital###(in ###propBaseType###) (err error) {\n" +
"\tres.###propName### = in\n" +
"\treturn\n" +
"}\n\n"
PropertySetSingleClassSingle template
var PropertySetSingleLiteral = "// Set###propCapital### is setter of ###comment###\n" +
"func (res *###propLongName###) Set###propCapital###(in ###propBaseType###) (err error) {\n" +
"\tres.###propName### = in\n" +
"\treturn\n" +
"}\n\n"
PropertySetSingleLiteral template
var PropertySetSingleLiteralMultiple = "// Set###propCapital### is setter of ###comment###\n" +
"func (res *###propLongName###) Set###propCapital###(in ###propBaseType###) (err error) {\n" +
"###setSingleLiteralMultiple###" +
"\terr = errors.New(\"Wrong ###propType### type. Allowed types are ###propAllowedTypes###\")\n" +
"\treturn\n" +
"}\n\n"
PropertySetSingleLiteralMultiple template
var PropertySingleRemove = "// removeObject removes object from property\n" +
"func (res *###propLongName###) removeObject(obj owl.Thing) {\n" +
"\tif v, ok := obj.(###propBaseType###); ok {\n" +
"\t\tif res.###propName###.IRI() == v.IRI() {\n" +
"\t\t\tres.Set###propCapital###(nil)\n" +
"\t\t}\n" +
"\t}\n" +
"\treturn\n" +
"}\n\n"
PropertySingleRemove template
var PropertyStringMultiple = "// String prints the object into a string\n" +
"func (res *###propLongName###) String() (ret string) {\n" +
"\tret += \"\\t###propName###: [\"\n" +
"\tfor i := range res.###propName### {\n" +
"###stringProp###" +
"\t}\n" +
"\tret += \"]\\n\"\n" +
"\treturn\n" +
"}\n\n"
PropertyStringMultiple template
var PropertyStringSingle = "// String prints the object into a string\n" +
"func (res *###propLongName###) String() (ret string) {\n" +
"\tret += \"\\t###propName###: [\"\n" +
"###stringProp###" +
"\tret += \"]\\n\"\n" +
"\treturn\n" +
"}\n\n"
PropertyStringSingle template
var PropertyStructCommon = "type propCommon struct {\n" +
"\tiri string // resource iri\n" +
"\ttyp string // type of resource\n" +
"\tmodel *Model // pointer to model\n" +
"}\n\n"
PropertyStructCommon template
var PropertyStructMultipleClass = "// ###propLongName### is ###comment###\n" +
"type ###propLongName### struct {\n" +
"\t###propName### map[string]###propType###\n" +
"}\n\n"
PropertyStructMultipleClass template
var PropertyStructMultipleLiteral = "// ###propLongName### is ###comment###\n" +
"type ###propLongName### struct {\n" +
"\t###propName### []###propType###\n" +
"}\n\n"
PropertyStructMultipleLiteral template
var PropertyStructSingle = "// ###propLongName### is ###comment###\n" +
"type ###propLongName### struct {\n" +
"\t###propName### ###propType###\n" +
"}\n\n"
PropertyStructSingle template
var PropsInit = "// propsInit initializes the property from a graph node\n" +
"func (res *s###className###) propsInit(pred *rdf.Edge) (err error) {\n" +
"\tswitch pred.Pred.String() {\n" +
"###initSwitchProps###" +
"\tdefault:\n" +
"###parentPropInit###" +
"\t}\n" +
"\treturn\n" +
"}\n\n"
PropsInit template
var PropsString = "// propsString prints the object into a string\n" +
"func (res *s###className###) propsString() (ret string) {\n" +
"\tret = \"\"\n" +
"###stringProps###" +
"\treturn\n" +
"}\n\n"
PropsString template
var PropsToGraph = "// propsToGraph adds all properties to the graph\n" +
"func (res *s###className###) propsToGraph(node *rdf.Node, g *rdf.Graph) {\n" +
"###toGraphProps###" +
"\treturn\n" +
"}\n\n"
PropsToGraph template
var RemoveNonInverse = "\tcase \"###propIRI###\":\n" +
"\t\tres.###propLongName.removeObject(obj)\n"
RemoveNonInverse template
var RemovePropMultiple = "\tcase \"###propIRI###\":\n" +
"\t\tif v, ok := obj.(###propBaseType###); ok {\n" +
"\t\t\tres.Del###propCapital###(v)\n" +
"\t\t}\n"
RemovePropMultiple template
var RemovePropSingle = "\tcase \"###propIRI###\":\n" +
"\t\tif v, ok := obj.(###propBaseType###); ok {\n" +
"\t\t\tif res.###propName###.IRI() == v.IRI() {\n" +
"\t\t\t\tres.Set###propCapital###(nil)\n" +
"\t\t\t}\n" +
"\t\t}\n"
RemovePropSingle template
var SetSingleClassMultiple = "\tif v, ok := in.(###propAllowedType###); ok {\n" +
"\t\tres.###propName### = v\n" +
"\t\treturn\n" +
"\t}\n"
SetSingleClassMultiple template
var SetSingleLiteralMultiple = "\tif v, ok := in.(###propAllowedType###); ok {\n" +
"\t\tres.###propName### = v\n" +
"\t\treturn\n" +
"\t}\n"
SetSingleLiteralMultiple template
var StringProp = "\tret += res.###propLongName###.String()\n"
StringProp template
var StringPropBool = "###indent###\tret += fmt.Sprintf(\"%v\", res.###propName######array###) + \", \"\n"
StringPropBool template
var StringPropClassMultiple = "\t\tret += res.###propName###[i].IRI() + \", \"\n"
StringPropClassMultiple template
var StringPropClassSingle = "\tif res.###propName### != nil {\n" +
"\t\tret += res.###propName###.IRI() + \", \"\n" +
"\t}\n"
StringPropClassSingle template
var StringPropFloat = "###indent###\tret += fmt.Sprintf(\"%f\", res.###propName######array###) + \", \"\n"
StringPropFloat template
var StringPropInt = "###indent###\tret += fmt.Sprintf(\"%d\", res.###propName######array###) + \", \"\n"
StringPropInt template
var StringPropInterface = "###indent###\tret += fmt.Sprintf(\"%v\", res.###propName######array###) + \", \"\n"
StringPropInterface template
var StringPropString = "###indent###\tret += res.###propName######array### + \", \"\n"
StringPropString template
var StringPropTime = "###indent###\tret += res.###propName######array###.String() + \", \"\n"
StringPropTime template
var StructImport = "\tmodel###importName### *im###importName###.Model\n"
StructImport template
var StructMap = "\tm###className### map[string]###className###\n"
StructMap template
var StructProperty = "\t###propLongName###\n"
StructProperty template
var ToGraphProp = "\tres.###propLongName###.toGraph(node, g)\n"
ToGraphProp template
Functions ¶
This section is empty.
Types ¶
This section is empty.