 | |
Network
configuration
with RDF | | |
Generate configuration files
Report template for generating final configuration files from RDF data
-
The report template is interpreted by my RDF report generating software [1]
The report template consists of:
:GenHostDetails :-
(
[ rep:cmd rep:for ; rep:pattern :HostPattern ;
rep:do
( [ rep:cmd rep:write ; rep:chan "dhc" ; rep:data
:DHCHost ]
[ rep:cmd rep:write ; rep:chan "dns"
; rep:data :DNSHost ]
)
]
) .
:HostPattern :-
( [ rep:var "Host" ]
[ rep:and
( [ rep:uri user:hostName ] [
rep:var "HostName" ] ),
( [ rep:uri rdfs:label ] [
rep:var "HostLabel" ] ),
( [ rep:uri dnsa:hostDomainName ] [ rep:var "HostFQDN"
] ),
( [ rep:uri dnsa:hostIPAddress ] [ rep:var "HostIP"
] ),
( [ rep:uri dhcp:hostMACAddress ] [ rep:var "HostMAC"
] )
]
) .
:DHCHost :-
( "host " [rep:var "HostName"] rep:nl
" {" rep:nl
" hardware ethernet " [rep:var "HostMAC"] " ;" rep:nl
" fixed-address " [rep:var
"HostFQDN"] " ;" rep:nl
" }" rep:nl
) .
The full report template used is at:
http://www.ninebynine.org/SWAD-E/Scenario-HomeNetwork/ConfigFiles.n3
[1] RDF for "Little Languages", Query, Transformation and Report Generation:
http://www.ninebynine.org/RDFNotes/RDFForLittleLanguages.htm
|