/**
* Copyright 2011 OpenDDR LLC
* This software is distributed under the terms of the GNU Lesser General Public License.
*
*
* This file is part of OpenDDR Simple APIs.
* OpenDDR Simple APIs is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* OpenDDR Simple APIs is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
*
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Simple APIs. If not, see .
*
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using W3c.Ddr.Models;
namespace W3c.Ddr.Simple
{
///
/// The Service interface is the core of the DDR Simple API
///
///
/// Using methods of Service the caller supplies Evidence representing the Delivery Context and an indication of the Properties of interest. These methods return PropertyValue objects which can then be queried to reveal the values of the Properties of interest.
/// The Service may be instantiated by a supplied factory class.
/// The class invokes the initialize method to establish a Default Vocabulary and to pass implementation specific settings.
/// Whether or not the underlying implementation combines more than one source of data is opaque to the user of the API. The API makes no assumptions about the number of sources of data.
/// All implementations are required to support Evidence consisting of name/value pairs of HTTP headers.
/// The methods of the Service interface fall into the following categories: Factory Methods, Query Methods, Information Methods, Initialization.
/// The "Factory" methods provide a means of instantiating objects that support the interfaces defined in the Recommendation that is consistent between implementations. Implementations may provide other means of instantiating the interfaces.
/// Query methods return values for Properties of the Delivery Context represented by the supplied Evidence.
/// Information methods return information about the implementation.
/// Initialization method initialize the library.
///
public interface IService
{
///
/// Initialize the Library. Called by the ServiceFactory Class to initialize the implementation. Implementation specific initialization parameters may be passed using the props parameter.
///
/// Throws when...
/// Throws when...
void Initialize(String defaultVocabularyIRI, Properties prprts);
///
/// Get Implementation Version.
///
/// Returns information about the implementation of the API including the current version. This may be used for diagnostic purposes, particularly where the implementation language does not already provide a means for obtaining such information.
String GetAPIVersion();
///
/// Get Data Version
///
/// Returns information about the underlying data (values for Properties) if the implementation has a versioning system for that information.
String GetDataVersion();
///
/// List Properties
///
/// Lists the combination of all known Properties and Aspects in all Vocabularies that can be used without causing a NameException to be thrown. The order in which Properties are listed is not significant.
IPropertyRef[] ListPropertyRefs();
///
/// Return the value of a specific Property
///
/// The specified IEvidence
/// The supplied Property
/// Return the value of a specific Property
/// Throws when...
IPropertyValue GetPropertyValue(IEvidence evdnc, IPropertyRef pr);
///
/// Return the value of a specific Property in its Default Aspect in the Vocabulary specified by propertyName
///
/// The specified IEvidence
/// The IPropertyName for the property
/// Return the value of a specific Property in its Default Aspect in the Vocabulary specified by propertyName
IPropertyValue GetPropertyValue(IEvidence evdnc, IPropertyName pn);
///
/// Return the value of a specific Property in its Default Aspect in the Default Vocabulary
///
/// The specified IEvidence
/// The name of the property
/// Return the value of a specific Property in its Default Aspect in the Default Vocabulary
/// Throws when...
IPropertyValue GetPropertyValue(IEvidence evdnc, String localPropertyName);
///
/// Return the value of a specific Property with a specific Aspect in a specific Vocabulary.
///
/// The specified IEvidence
/// The name of the property
/// The aspect of the property
/// The vocabulary of the property
/// Return the value of a specific Property with a specific Aspect in a specific Vocabulary.
/// Throws when...
IPropertyValue GetPropertyValue(IEvidence evdnc, String localPropertyName, String localAspectName, String vocabularyIRI);
///
/// Return all available Property values for all the Aspects and Vocabularies known by an implementation of the DDR Simple API
///
/// The specified IEvidence
/// Return all available Property values for all the Aspects and Vocabularies
/// Throws when...
IPropertyValues GetPropertyValues(IEvidence evdnc);
///
/// Return values for all the supplied Properties, returning empty values for those that are not known. An "unknown value" is distinguished by the PropertyValue exists() method returning false.
///
/// The specified IEvidence
/// The supplied Properties
/// Return values for all the supplied Properties
/// Throws when...
IPropertyValues GetPropertyValues(IEvidence evdnc, IPropertyRef[] prs);
///
/// Return all known values for the given Aspect of the Default Vocabulary
///
/// The specified IEvidence
/// The specified Aspect
/// Return all known values for the given Aspect of the Default Vocabulary
/// Throws when...
IPropertyValues GetPropertyValues(IEvidence evdnc, String localAspectName);
///
/// Return all known values for an Aspect of a specified Vocabulary
///
/// The specified IEvidence
/// The specified Aspect
/// The specified Namespace
/// Return all known values for an Aspect of a specified Vocabulary
/// Throws when...
IPropertyValues GetPropertyValues(IEvidence evdnc, String localAspectName, String vocabularyIRI);
///
/// Create PropertyName using Default Vocabulary
///
/// The name of the property.
/// Return the IPropertyName
/// Throws when the localPropertyName is not defined in the Default Vacabulary
IPropertyName NewPropertyName(String localPropertyName);
///
/// Create PropertyName with specified Vocabulary
///
/// The name of the property.
/// The Vocabulary namespace.
/// Return the IPropertyName
/// Throws when the localPropertyName is not defined in the Vacabulary identified by vocabularyIRI
IPropertyName NewPropertyName(String localPropertyName, String vocabularyIRI);
///
/// Create PropertyRef using Default Vocabulary and Aspect
///
/// The name of the property.
/// Return the IPropertyRef
/// Throws when the localPropertyName is not defined in the Default Vacabulary
IPropertyRef NewPropertyRef(String localPropertyName);
///
/// Create PropertyRef from PropertyName using Default Aspect. The Aspect of the PropertyRef created is the default Aspect of the Property in the Vocabulary determined by the propertyName parameter.
///
/// The IPropertyName for the property
/// Return the IPropertyRef
/// Throws when the pn is not defined
IPropertyRef NewPropertyRef(IPropertyName pn);
///
/// Create PropertyRef from PropertyName in Named Aspect. The namespace associated with the Aspect localAspectName is associated with the namespace of the propertyName parameter.
///
/// The IPropertyName for the property
/// The aspect of the property
/// Return the IPropertyRef
/// Throws when the pn and the localAspectName are not defined
IPropertyRef NewPropertyRef(IPropertyName pn, String localAspectName);
///
/// Create Empty HTTP Evidence
///
/// Return an empty Evidence
IEvidence NewHTTPEvidence();
///
/// Create HTTP Evidence from Map
///
/// The Map parameter contains name/value pairs representing HTTP Header names and values.
/// Return an Evidence filled with map
IEvidence NewHTTPEvidence(Dictionary map);
}
}