bcb4e51a409d94ae670de96afb8483a4f7855294Stephan Bosch// The MIT License
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen//
08d6658a4e2ec8104cd1307f6baa75fdb07a24f8Mark Washenberger// Copyright (c) 2004 Evren Sirin
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen//
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen// Permission is hereby granted, free of charge, to any person obtaining a copy
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen// of this software and associated documentation files (the "Software"), to
08d6658a4e2ec8104cd1307f6baa75fdb07a24f8Mark Washenberger// deal in the Software without restriction, including without limitation the
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen// sell copies of the Software, and to permit persons to whom the Software is
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen// furnished to do so, subject to the following conditions:
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen//
0df9428baed48afaff90b4d4f03792d2fd756a43Timo Sirainen// The above copyright notice and this permission notice shall be included in
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen// all copies or substantial portions of the Software.
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen//
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25d624dd86700c82cd28427f3d3bebe7c8f7f459Timo Sirainen// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen// IN THE SOFTWARE.
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainenpackage impl.owls.grounding;
714e2da5096fb52b8845d3c79f9bb26225a606c9Timo Sirainen
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainenimport java.net.URI;
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainenimport impl.owl.WrappedIndividual;
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainenimport org.mindswap.owl.OWLIndividual;
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainenimport org.mindswap.owls.grounding.MessageMap;
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainenimport org.mindswap.owls.process.Parameter;
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainenimport org.mindswap.owls.vocabulary.FLAServiceOnt;
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainenimport org.mindswap.owls.vocabulary.OWLS;
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainenimport org.mindswap.utils.URIUtils;
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainenpublic class UPnPMessageMapImpl extends WrappedIndividual implements MessageMap {
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen public UPnPMessageMapImpl(OWLIndividual ind) {
04870054863757edf048c81dcce3c5e7dec453cdTimo Sirainen super(ind);
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen }
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen public String getGroundingParameter() {
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen return getPropertyAsString(FLAServiceOnt.upnpParameter);
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen }
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen public void setGroundingParameter(String groundingParam) {
bd63b5b860658b01b1f46f26d406e1e4a9dc019aTimo Sirainen setProperty(FLAServiceOnt.upnpParameter, groundingParam);
15a07b47846c47a81d69a14d649564e222d6f742Timo Sirainen }
cd2cd224d3216a243d55c71c298a5b7684de0ac4Timo Sirainen
c1faff067b29fb48426cb84260adba563e93189aTimo Sirainen public String getTransformation() {
6882df5fbca4a09cdaa95f54d70bb31b5920528cTimo Sirainen return getPropertyAsString(OWLS.Grounding.xsltTransformationString);
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen }
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen public void setTransformation(String xsltTransformation) {
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainen setProperty(OWLS.Grounding.xsltTransformationString, xsltTransformation);
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen }
eacce2276278ce6a8176a9a100807dba50bbfb36Timo Sirainen
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen public Parameter getOWLSParameter() {
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen return (Parameter) getPropertyAs(OWLS.Grounding.owlsParameter, Parameter.class);
0df9428baed48afaff90b4d4f03792d2fd756a43Timo Sirainen }
0df9428baed48afaff90b4d4f03792d2fd756a43Timo Sirainen
0df9428baed48afaff90b4d4f03792d2fd756a43Timo Sirainen public void setOWLSParameter(Parameter param) {
0df9428baed48afaff90b4d4f03792d2fd756a43Timo Sirainen setProperty(OWLS.Grounding.owlsParameter, param);
0df9428baed48afaff90b4d4f03792d2fd756a43Timo Sirainen }
c0a87e5f3316a57e6f915882fa1951d0fbb74a61Timo Sirainen
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainen public String toString() {
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen return "[" + getOWLSParameter() + " -> " + getGroundingParameter() + "]";
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen }
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen
02a54da28f376dd66d7939d8546a196a0045b486Timo Sirainen public URI getGroundingParameterAsURI() {
4145cbac82bfc0c8bfeceeca0ef841700117930cTimo Sirainen return URIUtils.createURI(getGroundingParameter());
1d2b188f0eedc3cab6e27ceac5425a037f38042eTimo Sirainen }
eacce2276278ce6a8176a9a100807dba50bbfb36Timo Sirainen}
eacce2276278ce6a8176a9a100807dba50bbfb36Timo Sirainen