# # Location: http://www.groks.org/google-cse.rnc # Author: Stephen Deasey # Time-stamp: "2008-09-16 16:02:18" # # ~/.schemas/schemas.xml: # # # # # # # # # # # # Google documentation: # # http://www.google.com/coop/docs/cse/cse_file.html # datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes" namespace local = "" start = GoogleCustomizations ## Google Custom Search Engine (CSE) container. GoogleCustomizations = element GoogleCustomizations { attribute version { xsd:float { pattern="[0-9]+\.?[0-9]+" } } & CustomSearchEngine & IncludeLabels* & Annotations* } PublicURL = xsd:anyURI { pattern="https?://.+" } ## Search engine specification. CustomSearchEngine = element CustomSearchEngine { ## For stored CSEs: engine is accepting volunteer applications for labeling. attribute volunteers { xsd:boolean }? ## Keywords likely to appear in results, used to tune engine. & attribute keywords { xsd:string }? & element Title { text }? ## Will appear on Co-op home page of search engine. & element Description { text }? & Context & LookAndFeel? & SubscribedLinks? } Context = element Context { ## May include the term $q for users query attribute refinementsTitle { xsd:string }? & BackgroundLabels? & ( Facet? & Facet? & Facet? & Facet? ) & Synonyms? } ## The labels that are to be implicitly included in every query. BackgroundLabels = element BackgroundLabels { BackgroundLabel+ } BackgroundLabel = element Label { CommonLabelAttributes } RefinementLabel = element Label { CommonLabelAttributes & IgnoreBackgroundLabels? & Rewrite? } IgnoreBackgroundLabels = element IgnoreBackgroundLabels { xsd:boolean } Rewrite = element Rewrite { xsd:string { maxLength="100" } } AnnotationLabel = element Label { attribute name { xsd:string { pattern="[0-9A-z_]+" } } } CommonLabelAttributes = attribute name { xsd:string { pattern="[0-9A-z_]+" } } & ( attribute mode { string "FILTER" | string "ELIMINATE" } | ( attribute mode { string "BOOST" } & ( attribute weight { xsd:float { minInclusive="-1.0" maxInclusive="1.0" } } | attribute top { xsd:positiveInteger { minInclusive="1" maxInclusive="10" } } ) ) ) ## Include external lables file. IncludeLabels = element Include { attribute type { string "Annotations" } & attribute href { PublicURL } } Annotations = element Annotations { Annotation+ } Annotation = element Annotation { attribute about { PublicURL } & AnnotationLabel+ } LookAndFeel = element LookAndFeel { Logo? & Colors? } Logo = element Logo { attribute url { PublicURL } & attribute destination { PublicURL } & attribute height { xsd:positiveInteger { minInclusive="1" } }? } Colors = element Colors { attribute background { HexColor }? & attribute border { HexColor }? & attribute title { HexColor }? & attribute text { HexColor }? & attribute url { HexColor }? & attribute visited { HexColor }? & attribute light { HexColor }? } HexColor = xsd:string { pattern="#[0-9a-f]{6}" } Facet = element Facet { FacetItem? & FacetItem? & FacetItem? & FacetItem } FacetItem = element FacetItem { ## May include the term $q for users query. attribute title { xsd:string }? & (RefinementLabel | Redirect) } Redirect = element Redirect { ## May include the term $q for users query. attribute url { PublicURL } } SubscribedLinks = element SubscribedLinks { SubscribedLink+ } SubscribedLink = element SubscribedLink { ## Creator is equal to the user= parameter of the subscribed link. attribute creator { xsd:string { minLength="10" } } } Synonyms = element Synonyms { ## Max: 100 SynonymEntry+ } SynonymEntry = element SynonymEntry { attribute word { xsd:string { minLength="1" } } ## Max: 10 & Synonym? & Synonym? & Synonym? & Synonym? & Synonym? & Synonym? & Synonym? & Synonym? & Synonym? & Synonym } Synonym = element Synonym { text }