Deserialize() 정적인 개인적인 메소드

Deserializes the given N-Quads stream to a memory store.
static private Deserialize ( Stream inputStream ) : RDFMemoryStore
inputStream Stream
리턴 RDFMemoryStore
예제 #1
0
        /// <summary>
        /// Reads a memory store from a stream of the given RDF format.
        /// </summary>
        public static RDFMemoryStore FromStream(RDFStoreEnums.RDFFormats rdfFormat, Stream inputStream)
        {
            if (inputStream != null)
            {
                switch (rdfFormat)
                {
                case RDFStoreEnums.RDFFormats.NQuads:
                    return(RDFNQuads.Deserialize(inputStream));

                case RDFStoreEnums.RDFFormats.TriX:
                    return(RDFTriX.Deserialize(inputStream));
                }
            }
            throw new RDFStoreException("Cannot read RDF memory store from stream because given \"inputStream\" parameter is null.");
        }
예제 #2
0
        /// <summary>
        /// Reads a memory store from a file of the given RDF format.
        /// </summary>
        public static RDFMemoryStore FromFile(RDFStoreEnums.RDFFormats rdfFormat, string filepath)
        {
            if (!string.IsNullOrEmpty(filepath))
            {
                if (File.Exists(filepath))
                {
                    switch (rdfFormat)
                    {
                    case RDFStoreEnums.RDFFormats.NQuads:
                        return(RDFNQuads.Deserialize(filepath));

                    case RDFStoreEnums.RDFFormats.TriX:
                        return(RDFTriX.Deserialize(filepath));
                    }
                }
                throw new RDFStoreException("Cannot read RDF memory store from file because given \"filepath\" parameter (" + filepath + ") does not indicate an existing file.");
            }
            throw new RDFStoreException("Cannot read RDF memory store from file because given \"filepath\" parameter is null or empty.");
        }
예제 #3
0
        /// <summary>
        /// Reads the given file in the given RDF format to a memory store.
        /// </summary>
        public static RDFMemoryStore ReadRDF(RDFStoreEnums.RDFFormats rdfFormat, String filepath)
        {
            if (filepath != null)
            {
                if (File.Exists(filepath))
                {
                    switch (rdfFormat)
                    {
                    case RDFStoreEnums.RDFFormats.TriX:
                        return(RDFTriX.Deserialize(filepath));

                    case RDFStoreEnums.RDFFormats.NQuads:
                        return(RDFNQuads.Deserialize(filepath));
                    }
                }
                throw new RDFStoreException("Cannot read RDF file because given \"filepath\" parameter (" + filepath + ") does not indicate an existing file.");
            }
            throw new RDFStoreException("Cannot read RDF file because given \"filepath\" parameter is null.");
        }