找回密码
 注册
查看: 317|回复: 0

R语言 sos4R包 parse()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-9-30 11:58:33 | 显示全部楼层 |阅读模式
parse(sos4R)
parse()所属R语言包:sos4R

                                        Parsing Functions for XML Documents and Elements
                                         XML文档和元素的解析函数

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

The functions decode a given XML object to an R representation, which can be an object of a specific class, a list, a named character vector, ...
功能解码给定的XML对象的R表示,这可以是一个对象的一个特定的类的列表,指定的字符向量,...


用法----------Usage----------


parseFile(sos, file, verbose = FALSE, ...)
parseCSV(obj, verbose = FALSE)
parseNoParsing(obj)
parseCategoryObservation(obj, sos, verbose = FALSE)
parseComplexObservation(obj, sos, verbose = FALSE)
parseComponent(obj, sos, verbose = FALSE)
parseCompositePhenomenon(obj, sos, verbose = FALSE)
parseCountObservation(obj, sos, verbose = FALSE)
parseDataArray(obj, sos, verbose = FALSE)
parseElementType(obj, sos, verbose = FALSE)
parseEncoding(obj, sos, verbose = FALSE)
parseFeatureCollection(obj, sos)
parseField(obj, sos, verbose = FALSE)
parseFOI(obj, sos, verbose = FALSE)
parseGeometryObservation(obj, sos, verbose = FALSE)
parseMeasure(obj)
parseMeasurement(obj, sos, verbose = FALSE)
parseObservation(obj, sos, verbose = FALSE)
parseObservationCollection(obj, sos, verbose)
parseOM(obj, sos, verbose = FALSE)
parseOwsException(obj)
parseOwsExceptionReport(obj, verbose = FALSE)
parseOwsOperation(obj)
parseOwsRange(obj)
parseOwsServiceIdentification(obj)
parseOwsServiceProvider(obj)
parsePhenomenonProperty(obj, sos, verbose = FALSE)
parsePoint(obj, sos)
parsePosition(obj, sos)
parseResult(obj, sos, verbose = FALSE)
parseSamplingPoint(obj, sos)
parseSamplingTime(obj, format, verbose = FALSE)
parseSensorML(obj, sos, verbose = FALSE)
parseSosCapabilities(obj, sos)
parseSosFilter_Capabilities(obj, sos)
parseSosObservationOffering(obj, sos)
parseTemporalObservation(obj, sos, verbose = FALSE)
parseTextBlock(obj)
parseTimeGeometricPrimitiveFromParent(obj, format)
parseTimeInstant(obj, format)
parseTimeInstantProperty(obj, format)
parseTimePeriod(obj, format)
parseTimePosition(obj, format)
parseTruthObservation(obj, sos, verbose = FALSE)
parseValues(values, fields, encoding, sos, verbose = FALSE)



参数----------Arguments----------

参数:obj
The object to decode, normally objects of either  <RE>XMLNode</PRE> or <RE>XMLInternalDocument</PRE>.
对象进行解码,通常对象的任<RE>的XMLNode </ PRE>或<RE> XMLInternalDocument </ PRE>。


参数:sos
An object of class SOS-class, which may be utilized/required by some parsing functions to access other parsing functions or encoding information.
SOS级类,其可以被使用/访问其他的解析函数或编码信息所需的一些解析函数的一个目的。


参数:verbose
A boolean value indication whether information is printed out to the console during the process - potentially a lot of output!
一个布尔值,指示是否信息打印到控制台的过程中 - 一个潜在的大量输出!


参数:format
A character string defining the time format to be used in strptime.
在strptime定义的时间格式,可以使用一个字符串。


参数:values
The values to be parsed in parseValues(...).
在parseValues(...)的值被解析。


参数:fields
Field information  in parseValues(...), a named list.
现场parseValues(...),命名列表。


参数:file
Name of the file to be parsed in sosParse(...).
在sosParse(...)被解析的文件的名称。


参数:encoding
Encoding information in parseValues(...), an object of class SweTextBlock.
编码信息parseValues(...),对象类SweTextBlock。


参数:...
Additional arguments that are parsed to xmlParse(...) in sosParse(...).
其他的参数被解析,xmlParse(...)sosParse(...)的。


Details

详细信息----------Details----------

The naming of the functions follow the following rule: parse[optional: namespace prefix][name of the XML element to be parsed]
的函数的命名遵循以下规则:解析[可选的命名空间前缀] [被解析的XML元素的名称]

Not all parsing function that have a SOS object or verbose in their signature, but few actually use it at this points of development. Some of the parsing functions are <STRONG>exchangeable</STRONG> when creating a new SOS connection. Please see the examples!
并非所有的分析功能,有一个SOS对象或verbose在他们的签名,但很少真正使用它的发展在这点。的解析函数<STRONG>交换,</ STRONG>当创建一个新的SOS连接。请看到的例子!

parseOM is a special function in the respect that it matches sub parsing function depending on an objects xmlName from the list of the given SOS's parsing functions.
parseOM是一个特殊的功能方面,它匹配子解析函数的对象xmlName从给定的SOS的解析函数的列表。

parseNoParsing is a convenience function that directly returns the object without any changes.
parseNoParsing是一个方便的功能,直接返回的对象没有任何变化。

sosParse allows parsing of files for all elements that have a parsers registered with the given SOS.
sosParse允许解析文件的所有元素,有一个解析器注册的SOS。


值----------Value----------

An objects of a specific class depending on the parsing method and the passed object, possibly even lists or named character vectors.
根据一个特定的类的对象的解析方法和传递的对象,甚至可能是列表或指定的字符向量。


警告----------Warning ----------

Functions might result in error if parsed an object of the wrong type, because that is normally not checked.
如果解析错误类型的对象,因为,通常不检查功能,可能会导致错误。

Some of the functions are placeholders for future implementations!
一些功能是未来实现的占位符!


(作者)----------Author(s)----------


Daniel Nuest <a href="mailto:daniel.nuest@uni-muenster.de">daniel.nuest@uni-muenster.de</a>



参见----------See Also----------

SosParsingFunctions, sosParsers-methods
SosParsingFunctions,sosParsers-methods


实例----------Examples----------


# parsing a XML string to an exception report object[解析一个XML字符串异常报告对象]
er.doc <- xmlParseDoc("<ows:ExceptionReport xmlnsws=\"http://www.opengis.net/ows/1.1\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" version=\"1.0.0\" xsi:schemaLocation=\"http://schemas.opengis.net/ows/1.1.0/owsExceptionReport.xsd\"><ows:Exception exceptionCode=\"VersionNegotiationFailed\" locator=\"AcceptVersions\"><ows:ExceptionText>The parameter 'AcceptVersions' does not contain the version of this SOS: '1.0.0'</ows:ExceptionText></ows:Exception></ows:ExceptionReport>")
er.parsed <- parseOwsExceptionReport(er.doc)
print(er.parsed)
str(er.parsed)

## Not run: [#不运行:]
# save and re-parse an observation from file[保存并重新从文件中解析的观察]
obsId <- getObservationById(sos = mySOS, observationId = "o_3508493",
                saveOriginal = TRUE)
.files <- list.files(getwd())
.startWithO_ <- .files %in% grep("o_", .files, value=TRUE)
.observationFiles <- subset(.files, .startWithO_)

obsId <- parseFile(sos = mySOS, file = .observationFiles[[1]])

## End(Not run)[#(不执行)]


转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2025-6-9 22:22 , Processed in 0.030164 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表