private List <DatasetLocation> ReadDatasetsLocations() { XPathDocument doc = new XPathDocument(m_config.ConfigurationFile); string rootDir = System.IO.Path.GetDirectoryName(m_config.ConfigurationFile.Absolute); XPathNavigator nav = doc.CreateNavigator(); XPathNodeIterator datasetsIterator = nav.Select("/load_datasets_config/datasets/dataset"); var datasetsLocations = new List <DatasetLocation>(); XPathNavigator iter; while (datasetsIterator.MoveNext()) { var datasetLocation = new DatasetLocation(); iter = datasetsIterator.Current.SelectSingleNode("dataset_name"); datasetLocation.DatasetName = iter.Value; iter = datasetsIterator.Current.SelectSingleNode("source_artifacts_location"); datasetLocation.SourceArtifactsLocation = System.IO.Path.Combine(rootDir, iter.Value); iter = datasetsIterator.Current.SelectSingleNode("target_artifacts_location"); datasetLocation.TargetArtifactsLocation = System.IO.Path.Combine(rootDir, iter.Value); iter = datasetsIterator.Current.SelectSingleNode("answer_set_location"); datasetLocation.AnswerSetLocation = System.IO.Path.Combine(rootDir, iter.Value); datasetsLocations.Add(datasetLocation); } return(datasetsLocations); }
public DatasetLocation ToSdkObject() { var datasetLocation = new DatasetLocation() { FolderPath = this.FolderPath, FileName = this.FileName }; this.AdditionalProperties?.ForEach(item => datasetLocation.Add(item.Key, item.Value)); return(datasetLocation); }
private List<DatasetLocation> ReadDatasetsLocations() { XPathDocument doc = new XPathDocument(m_config.ConfigurationFile); string rootDir = System.IO.Path.GetDirectoryName(m_config.ConfigurationFile.Absolute); XPathNavigator nav = doc.CreateNavigator(); XPathNodeIterator datasetsIterator = nav.Select("/load_datasets_config/datasets/dataset"); var datasetsLocations = new List<DatasetLocation>(); XPathNavigator iter; while (datasetsIterator.MoveNext()) { var datasetLocation = new DatasetLocation(); iter = datasetsIterator.Current.SelectSingleNode("dataset_name"); datasetLocation.DatasetName = iter.Value; iter = datasetsIterator.Current.SelectSingleNode("source_artifacts_location"); datasetLocation.SourceArtifactsLocation = System.IO.Path.Combine(rootDir, iter.Value); iter = datasetsIterator.Current.SelectSingleNode("target_artifacts_location"); datasetLocation.TargetArtifactsLocation = System.IO.Path.Combine(rootDir, iter.Value); iter = datasetsIterator.Current.SelectSingleNode("answer_set_location"); datasetLocation.AnswerSetLocation = System.IO.Path.Combine(rootDir, iter.Value); datasetsLocations.Add(datasetLocation); } return datasetsLocations; }