pjoiner / dwc-a_dotnet Goto Github PK
View Code? Open in Web Editor NEWA simple Darwin Core Archive Reader for dotnet
License: MIT License
A simple Darwin Core Archive Reader for dotnet
License: MIT License
public static IEnumerable<string> GetListOf(this IRow row, string term)
{
var delimiter = row.FieldMetaData
.FirstOrDefault(f => f.Term == term)?
.DelimitedBy;
if(delimiter == null)
{
return new List<string>(){row[term]};
}
return row[term].Split(delimiter);
}
public static bool TryGetListOf(this IRow row, string term, out IEnumerable<string> list)
{
if(row.FieldMetaData.IndexOf(term) == -1)
{
list = null;
return false;
}
list = row.GetListOf(term);
return true;
}
This is to support the LinQPad 6 driver
This will be useful with dotnet interactive. Also, this should be configurable.
Affected methods
T Convert(string term)
T Convert(int index)
object Convert(string term, Type type)
object Convert(int index, Type type)
Should be writer.WriteLine(rowBuilder.Build());
If index field is already defined in meta.xml then a duplicate id field is added to the metadata. Skip this step if id points to a index that already exists
For netstandard2.0 support use System.Memory
The following line will only read up to the first newline
"abc,"def\nghi",lmn"
So only the following fields will be returned
abc
def
We need to allow the tokenizer to cooperate with the StreamReader to ask for more data so it can parse the complete line.
Microsoft.SourceLink.GitHub => 8.0.0
Sometimes there are multiple files in the archive with the same rowtype
Since default values aren't accessible from FieldMetaData. Should just return the list of FieldType values with no index.
By design the DwC-A standard allows the addition of terms. The Terms class should all extension with custom terms. Suggest using a partial class.
Work around the IOException meta.xml already exists
How does this affect older apps that target net5.0?
link should be https://github.com/pjoiner/DwC-A_dotnet/wiki
Clicking on documentation link returns 404
Breaking change on namespace only
After doing some bench marking it was discovered that it is faster to use a LinQ Grouping or ILookup than to use the index code in the FileReader. Remove the code and associated unit tests to simplify the codebase.
ArchiveFolder may be null on Dispose which throws an NullReference exception. Need a null check
If there is no meta.xml file then the Fields property of CoreFileMetaData and ExtensionFileMetaData will be null. Create an empty FieldMetaData object using null for the Id parameter to prevent possible nullReferenceExceptions.
If no meta.xml file is found then the folder must contain only one data file or throw a more descriptive exception.
If applicable
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.